Fixed the command blocker

This commit is contained in:
Garbage Mule 2011-06-05 07:24:56 +02:00
parent 09ff211987
commit eadcaa682b
4 changed files with 11 additions and 7 deletions

Binary file not shown.

View File

@ -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);

View File

@ -245,7 +245,7 @@ public class MAUtils
return new Configuration(configFile);
}
public static String[] getDisabledCommands()
public static List<String> 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<String> result = new LinkedList<String>();
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;

View File

@ -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<String> DISABLED_COMMANDS;
public MobArena()
{