Java 类org.bukkit.event.player.PlayerUnleashEntityEvent 实例源码

项目:bskyblock    文件:IslandGuard.java   
/**
 * Prevents the leash use
 *
 * @param e
 */
@EventHandler(priority = EventPriority.LOW)
public void onLeashUse(final PlayerUnleashEntityEvent 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);
        }
    }
}
项目:NovaGuilds    文件:RegionInteractListener.java   
@EventHandler
public void onPlayerUnleashEntity(PlayerUnleashEntityEvent 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())) {
        if(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_UNLEASH.send(player);
        }
    }
}
项目:acidisland    文件:IslandGuard.java   
/**
 * Prevents the leash use
 *
 * @param e
 */
@EventHandler(priority = EventPriority.LOW)
public void onLeashUse(final PlayerUnleashEntityEvent 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();
        }
    }
}
项目:askyblock    文件:IslandGuard.java   
/**
 * Prevents the leash use
 *
 * @param e
 */
@EventHandler(priority = EventPriority.LOW)
public void onLeashUse(final PlayerUnleashEntityEvent 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();
        }
    }
}
项目:FactionsXL    文件:EntityProtectionListener.java   
@EventHandler
public void onPlayerUnLeashEntity(PlayerUnleashEntityEvent event) {
    forbidIfInProtectedTerritory(event.getPlayer(), event.getEntity(), event, UNLEASH);
}
项目:CraftoPlugin    文件:FreezeComponent.java   
@EventHandler
public void playerUnleashEntity(final PlayerUnleashEntityEvent event) {
    if (!this.frozenPlayers.isEmpty() && !event.isCancelled() && this.frozenPlayers.containsKey(event.getPlayer().getUniqueId())) {
        event.setCancelled(true);
    }
}
项目:CraftoPlugin    文件:EntityProtectionBreakListener.java   
@EventHandler
public void onPlayerUnleashEntity(final PlayerUnleashEntityEvent event) {
    debug("onPlayerUnleashEntity() called!");
    if (!this.canInteract(event.getEntity(), event.getPlayer())) { event.setCancelled(true); }
}
项目:NucleusFramework    文件:InternalLeashTracker.java   
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
private void onPlayerUnleash(PlayerUnleashEntityEvent event) {
    removePlayerLeash(event.getPlayer().getUniqueId(), event.getEntity());
}