/** * Prevents the leash use * * @param e */ @EventHandler(priority = EventPriority.LOW) public void onLeashUse(final PlayerLeashEntityEvent e) { if (DEBUG) { plugin.getLogger().info(e.getEventName()); } if (Util.inWorld(e.getEntity())) { if (e.getPlayer() != null) { Player player = e.getPlayer(); if (actionAllowed(player, e.getEntity().getLocation(),SettingsFlag.LEASH)) { return; } Util.sendMessage(player, plugin.getLocale(player.getUniqueId()).get("island.protected")); e.setCancelled(true); } } }
/** * Prevents the leash use * * @param e */ @EventHandler(priority = EventPriority.LOW) public void onLeashUse(final PlayerLeashEntityEvent e) { if (DEBUG) { plugin.getLogger().info(e.getEventName()); } if (inWorld(e.getEntity())) { if (e.getPlayer() != null) { Player player = e.getPlayer(); if (actionAllowed(player, e.getEntity().getLocation(),SettingsFlag.LEASH)) { return; } Util.sendMessage(player, ChatColor.RED + plugin.myLocale(player.getUniqueId()).islandProtected); e.setCancelled(true); e.getPlayer().updateInventory(); } } }
@EventHandler public void onLeash(PlayerLeashEntityEvent e) { KingdomFactionsPlayer p =PlayerModule.getInstance().getPlayer(e.getPlayer()); if(p.getSettingsProfile().hasAdminMode()) return; if(!p.canBuild(e.getEntity().getLocation())) { e.setCancelled(!ProtectionModule.getInstance().tryInfluence(p, 200)); } }
/** * Prevents use of leashes outside the game area * @param event */ @EventHandler(priority = EventPriority.LOW, ignoreCancelled=true) public void onLeashUse(final PlayerLeashEntityEvent event) { if (event.getEntity().getWorld().equals(getBeaconzWorld())) { if (getGameMgr().getGame(event.getEntity().getLocation()) == null) { event.setCancelled(true); event.getPlayer().sendMessage(ChatColor.RED + Lang.errorYouCannotDoThat); } } }
@EventHandler public void onPlayerLeashEntity(PlayerLeashEntityEvent event) { List<String> denyRiding = Config.REGION_DENYRIDING.getStringList(); Player player = event.getPlayer(); Entity entity = event.getEntity(); NovaPlayer nPlayer = PlayerManager.getPlayer(player); if(denyRiding.contains(entity.getType().name()) && RegionManager.get(entity) != null && (!plugin.getRegionManager().canInteract(player, entity) || (!nPlayer.getPreferences().getBypass() && !nPlayer.hasPermission(GuildPermission.MOB_LEASH))) && (!(entity instanceof Vehicle) || !PlayerManager.getPlayer(player).isVehicleListed((Vehicle) event.getEntity()))) { event.setCancelled(true); Message.CHAT_REGION_DENY_LEASH.send(event.getPlayer()); } }
@EventHandler(priority = EventPriority.LOW) public void OnPlayerLeashEvent(PlayerLeashEntityEvent event) { LoreCraftableMaterial craftMat = LoreCraftableMaterial.getCraftMaterial(event.getPlayer().getItemInHand()); if (craftMat == null) { return; } craftMat.onPlayerLeashEvent(event); }
@EventHandler(priority = EventPriority.NORMAL) public void onPlayerLeash(PlayerLeashEntityEvent event) { if (event.getEntity() instanceof LivingEntity) { if (MobLib.isMobLibEntity((LivingEntity) event.getEntity())) { CivMessage.sendError(event.getPlayer(), "This beast cannot be tamed."); event.setCancelled(true); return; } } }
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) private void onPlayerLeash(PlayerLeashEntityEvent event) { UUID playerId = event.getPlayer().getUniqueId(); Entity leashHolder = event.getLeashHolder(); if (event.getPlayer().equals(leashHolder)) addPlayerLeash(playerId, event.getEntity()); else { removePlayerLeash(playerId, event.getEntity()); } }
@EventHandler public void onPlayerLeashEntity(PlayerLeashEntityEvent event) { forbidIfInProtectedTerritory(event.getPlayer(), event.getEntity(), event, LEASH); }
@EventHandler public void entityLeashEvent(PlayerLeashEntityEvent event) { if (this.isBall(event.getEntity())) { event.setCancelled(true); } }
public void onPlayerLeashEvent(PlayerLeashEntityEvent event) { for (ItemComponent comp : this.components.values()) { comp.onPlayerLeashEvent(event); } }
@EventHandler public void onPlayerLeashEntity(final PlayerLeashEntityEvent event) { debug("onPlayerLeashEntity() called!"); if (!this.canInteract(event.getEntity(), event.getPlayer())) { event.setCancelled(true); } }
public void onPlayerLeashEvent(PlayerLeashEntityEvent event) { }
public void onPlayerLeashEvent(PlayerLeashEntityEvent event) {}