mirror of
https://github.com/garbagemule/MobArena.git
synced 2025-01-11 10:59:09 +01:00
Fixed the command blocker
This commit is contained in:
parent
09ff211987
commit
eadcaa682b
BIN
MobArena.jar
BIN
MobArena.jar
Binary file not shown.
@ -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);
|
||||
|
@ -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;
|
||||
|
@ -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()
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user