IslandGuard.java 文件源码

java
阅读 24 收藏 0 点赞 0 评论 0

项目:bskyblock 作者:
/**
 * 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();
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号