/**
* 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);
}
}
}
java类org.bukkit.event.player.PlayerUnleashEntityEvent的实例源码
IslandGuard.java 文件源码
项目:bskyblock
阅读 20
收藏 0
点赞 0
评论 0
RegionInteractListener.java 文件源码
项目:NovaGuilds
阅读 26
收藏 0
点赞 0
评论 0
@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);
}
}
}
IslandGuard.java 文件源码
项目:acidisland
阅读 28
收藏 0
点赞 0
评论 0
/**
* 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();
}
}
}
IslandGuard.java 文件源码
项目:askyblock
阅读 36
收藏 0
点赞 0
评论 0
/**
* 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();
}
}
}
EntityProtectionListener.java 文件源码
项目:FactionsXL
阅读 25
收藏 0
点赞 0
评论 0
@EventHandler
public void onPlayerUnLeashEntity(PlayerUnleashEntityEvent event) {
forbidIfInProtectedTerritory(event.getPlayer(), event.getEntity(), event, UNLEASH);
}
FreezeComponent.java 文件源码
项目:CraftoPlugin
阅读 26
收藏 0
点赞 0
评论 0
@EventHandler
public void playerUnleashEntity(final PlayerUnleashEntityEvent event) {
if (!this.frozenPlayers.isEmpty() && !event.isCancelled() && this.frozenPlayers.containsKey(event.getPlayer().getUniqueId())) {
event.setCancelled(true);
}
}
EntityProtectionBreakListener.java 文件源码
项目:CraftoPlugin
阅读 27
收藏 0
点赞 0
评论 0
@EventHandler
public void onPlayerUnleashEntity(final PlayerUnleashEntityEvent event) {
debug("onPlayerUnleashEntity() called!");
if (!this.canInteract(event.getEntity(), event.getPlayer())) { event.setCancelled(true); }
}
InternalLeashTracker.java 文件源码
项目:NucleusFramework
阅读 22
收藏 0
点赞 0
评论 0
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
private void onPlayerUnleash(PlayerUnleashEntityEvent event) {
removePlayerLeash(event.getPlayer().getUniqueId(), event.getEntity());
}