@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
public void onPlayerCommand(PlayerCommandPreprocessEvent event) {
Player player = event.getPlayer();
String message = event.getMessage();
World world = player.getWorld();
PluginConfig worldConfig = plugin.getConfig(world);
int spaceIndex = message.indexOf(' ');
String command = (spaceIndex > 0) ? message.substring(1, spaceIndex) : message.substring(1);
if (plugin.isFeatureEnabled(world, Feature.DISABLED_COMMANDS) && worldConfig.getStringList(Config.FEATURE_DISABLED_COMMANDS_COMMANDS).contains(command) && this.isProtected(player.getLocation())) {
event.setCancelled(true);
player.sendMessage(ChatColor.RED + "The /" + command + " is disabled in bloodmoon dungeons!");
}
}
DungeonListener.java 文件源码
java
阅读 26
收藏 0
点赞 0
评论 0
项目:BloodMoon
作者:
评论列表
文章目录