diff --git a/MobArena.jar b/MobArena.jar index e1af429..7ded852 100644 Binary files a/MobArena.jar and b/MobArena.jar differ diff --git a/src/com/garbagemule/MobArena/MADisabledCommands.java b/src/com/garbagemule/MobArena/MADisabledCommands.java index 461c6b0..cd29808 100644 --- a/src/com/garbagemule/MobArena/MADisabledCommands.java +++ b/src/com/garbagemule/MobArena/MADisabledCommands.java @@ -24,7 +24,10 @@ public class MADisabledCommands extends PlayerListener if (!ArenaManager.playerSet.contains(p)) return; - if (!Arrays.asList(plugin.DISABLED_COMMANDS).contains(event.getMessage().substring(1))) + String[] args = event.getMessage().split(" "); + + if (!plugin.DISABLED_COMMANDS.contains(event.getMessage().substring(1).trim()) && + !plugin.DISABLED_COMMANDS.contains(args[0])) return; event.setCancelled(true); diff --git a/src/com/garbagemule/MobArena/MAUtils.java b/src/com/garbagemule/MobArena/MAUtils.java index eb37267..159b748 100644 --- a/src/com/garbagemule/MobArena/MAUtils.java +++ b/src/com/garbagemule/MobArena/MAUtils.java @@ -245,7 +245,7 @@ public class MAUtils return new Configuration(configFile); } - public static String[] getDisabledCommands() + public static List getDisabledCommands() { Configuration c = ArenaManager.config; c.load(); @@ -254,11 +254,11 @@ public class MAUtils c.setProperty("disabledcommands", commands); c.save(); - String[] result = commands.split(","); - for (int i = 0; i < result.length; i++) + List result = new LinkedList(); + for (String s : commands.split(",")) { - result[i] = result[i].trim(); - System.out.println(result[i]); + System.out.println(s.trim()); + result.add(s.trim()); } return result; diff --git a/src/com/garbagemule/MobArena/MobArena.java b/src/com/garbagemule/MobArena/MobArena.java index 7daa208..c07b0fb 100644 --- a/src/com/garbagemule/MobArena/MobArena.java +++ b/src/com/garbagemule/MobArena/MobArena.java @@ -1,5 +1,6 @@ package com.garbagemule.MobArena; +import java.util.List; import org.bukkit.entity.Player; import org.bukkit.event.Event; import org.bukkit.event.Event.Priority; @@ -23,7 +24,7 @@ public class MobArena extends JavaPlugin "ready", "notready", "enabled", "force", "config", "setwarp", "addspawn", "delspawn", "setregion", "expandregion", "protect", "undo", "dooooo", "reset"}; - public String[] DISABLED_COMMANDS; + public List DISABLED_COMMANDS; public MobArena() {