Examples of PaintingBreakByEntityEvent


Examples of org.bukkit.event.painting.PaintingBreakByEntityEvent

  }

  @HawkEvent(dataType = DataType.PAINTING_BREAK)
  public void onPaintingBreak(PaintingBreakEvent event) {
    if (event.getCause() != RemoveCause.ENTITY) return;
    PaintingBreakByEntityEvent e = (PaintingBreakByEntityEvent)event;
    if (e.getRemover() instanceof Player)
      DataManager.addEntry(new DataEntry((Player)e.getRemover(), DataType.PAINTING_BREAK, e.getPainting().getLocation(), ""));
  }
View Full Code Here

Examples of org.bukkit.event.painting.PaintingBreakByEntityEvent

    }

    long start = System.currentTimeMillis();

    if (event instanceof PaintingBreakByEntityEvent) {
      PaintingBreakByEntityEvent evt = (PaintingBreakByEntityEvent) event;
      Painting painting = evt.getPainting();
      Object remover = evt.getRemover();
      WorldCoord worldCoord;
     
      try {
        TownyWorld townyWorld = TownyUniverse.getDataSource().getWorld(painting.getWorld().getName());
         
        if (!townyWorld.isUsingTowny())
          return;
       
        worldCoord = new WorldCoord(townyWorld, Coord.parseCoord(painting.getLocation()));
      } catch (NotRegisteredException e1) {
        //TownyMessaging.sendErrorMsg(player, TownySettings.getLangString("msg_err_not_configured"));
        event.setCancelled(true);
        return;
      }
     
      if (remover instanceof Player) {
        Player player = (Player) evt.getRemover();

        //Get destroy permissions (updates if none exist)
        boolean bDestroy = TownyUniverse.getCachePermissions().getCachePermission(player, painting.getLocation(), TownyPermission.ActionType.DESTROY);

        PlayerCache cache = plugin.getCache(player);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.