@EventHandler
public void noCommand(PlayerCommandPreprocessEvent e) {
if(!plugin.hasSnowballPerms(e.getPlayer()) &&
Utility.isInsideSnowball(e.getPlayer().getLocation(), plugin, false)) {
String cmd = e.getMessage();
if(cmd == null)
return;
cmd = cmd.indexOf(" ") != -1 ? cmd.substring(0, cmd.indexOf(" ")) : cmd;
if(cmd.charAt(0) == '/' && cmd.length() > 1)
cmd = cmd.substring(1);
for(int i = 0; i < plugin.validCommands.length; i++) {
if(cmd.equalsIgnoreCase(plugin.validCommands[i]))
return;
}
e.setCancelled(true);
e.getPlayer().sendMessage(ChatColor.DARK_AQUA + "You are only permitted to use /spawn, /home, and " +
"/warp while in the Snowball arena.");
}
}
IceBallLimitListener.java 文件源码
java
阅读 22
收藏 0
点赞 0
评论 0
项目:IceBall
作者:
评论列表
文章目录