/**
* 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 (!Util.inWorld(e.getPlayer()) || e.getPlayer().isOp() || VaultHelper.hasPerm(e.getPlayer(), Settings.PERMPREFIX + "mod.bypassprotect")
|| plugin.getIslands().playerIsOnIsland(e.getPlayer()) || plugin.getIslands().isAtSpawn(e.getPlayer().getLocation())) {
return;
}
// Check island
Island island = plugin.getIslands().getProtectedIslandAt(e.getPlayer().getLocation());
if (island == null) {
return;
}
if (!island.getFlag(SettingsFlag.THROW_EGGS)) {
e.setHatching(false);
Util.sendMessage(e.getPlayer(), plugin.getLocale(e.getPlayer().getUniqueId()).get("island.protected"));
//e.getPlayer().updateInventory();
}
}
IslandGuard.java 文件源码
java
阅读 24
收藏 0
点赞 0
评论 0
项目:bskyblock
作者:
评论列表
文章目录