/**
* Handle visitor chicken egg throwing
* @param e
*/
@EventHandler(priority = EventPriority.LOW, ignoreCancelled = true)
public void onEggThrow(PlayerEggThrowEvent e) {
if (DEBUG) {
plugin.getLogger().info("egg throwing = " + e.getEventName());
}
if (!inWorld(e.getPlayer()) || e.getPlayer().isOp() || VaultHelper.checkPerm(e.getPlayer(), Settings.PERMPREFIX + "mod.bypassprotect")
|| plugin.getGrid().playerIsOnIsland(e.getPlayer()) || plugin.getGrid().isAtSpawn(e.getPlayer().getLocation())) {
return;
}
// Check island
Island island = plugin.getGrid().getProtectedIslandAt(e.getPlayer().getLocation());
if (island == null) {
return;
}
if (!island.getIgsFlag(SettingsFlag.EGGS)) {
e.setHatching(false);
Util.sendMessage(e.getPlayer(), ChatColor.RED + plugin.myLocale(e.getPlayer().getUniqueId()).islandProtected);
//e.getPlayer().updateInventory();
}
return;
}
IslandGuard.java 文件源码
java
阅读 24
收藏 0
点赞 0
评论 0
项目:acidisland
作者:
评论列表
文章目录