コード例 #1
0
  @EventHandler(priority = EventPriority.HIGHEST)
  public void onPlayerShearEntity(PlayerShearEntityEvent event) {
    if (event.isCancelled()) return;

    final Player player = event.getPlayer();
    final Entity entity = event.getEntity();

    if (player.getWorld() != plugin.getIslandWorld()) return;
    if (player.isOp()) return;
    if (player.hasPermission("islandworld.bypass.island")) return;

    if (entity != null && !plugin.canBuildOnLocation(player, entity.getLocation()))
      event.setCancelled(true);

    plugin.debug("Event :" + event.getEventName() + ", cancelled:" + event.isCancelled());
  }
コード例 #2
0
 @EventHandler
 public void Sheared(PlayerShearEntityEvent Event) {
   SkillHandlers.HandleFarming(Event.getPlayer().getName(), 1 + new Random().nextInt(3));
 }