Main.java 文件源码

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

项目:defend-the-village 作者:
@EventHandler(priority = EventPriority.HIGHEST)
public void onCommandPre(PlayerCommandPreprocessEvent ev) {
    if (this.am.isInGame(ev.getPlayer())) {
        // Only if the player is in game
        boolean c = true;

        // Is it allowed?
        for (String com : this.allowedCommands) {
            if (ev.getMessage().toLowerCase().startsWith("/" + com)) {
                c = false;
            }
        }
        if (c)
            // If the command is not allowed, notify the user
            s(ev.getPlayer(), this.config.get("no_command_in_game"));
        ev.setCancelled(c);
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号