Fix commandblocker not blocking properly. Resolves #586

This commit is contained in:
JeromSar 2015-05-10 23:28:13 +02:00
parent 42266c37ea
commit ea6bfa8387
3 changed files with 8 additions and 5 deletions

View File

@ -1,3 +1,3 @@
#Build Number for ANT. Do not edit! #Build Number for ANT. Do not edit!
#Sun May 10 23:13:43 CEST 2015 #Sun May 10 23:27:12 CEST 2015
build.number=995 build.number=998

View File

@ -709,8 +709,6 @@ public class TFM_PlayerListener implements Listener
TFM_Log.info(String.format("[PREPROCESS_COMMAND] %s(%s): %s", player.getName(), ChatColor.stripColor(player.getDisplayName()), command), true); TFM_Log.info(String.format("[PREPROCESS_COMMAND] %s(%s): %s", player.getName(), ChatColor.stripColor(player.getDisplayName()), command), true);
} }
command = command.toLowerCase().trim();
// Blocked commands // Blocked commands
if (TFM_CommandBlocker.isCommandBlocked(command, event.getPlayer(), true)) if (TFM_CommandBlocker.isCommandBlocked(command, event.getPlayer(), true))
{ {

View File

@ -112,17 +112,22 @@ public class TFM_CommandBlocker
return false; return false;
} }
command = command.toLowerCase().trim();
if (command.split(" ")[0].contains(":")) if (command.split(" ")[0].contains(":"))
{ {
TFM_Util.playerMsg(sender, "Plugin-specific commands are disabled."); TFM_Util.playerMsg(sender, "Plugin-specific commands are disabled.");
return true; return true;
} }
if (command.startsWith("/")) {
command = command.substring(1);
}
final String[] commandParts = command.split(" "); final String[] commandParts = command.split(" ");
String subCommand = null; String subCommand = null;
if (commandParts.length > 1) if (commandParts.length > 1)
{ {
command = commandParts[0].substring(1);
subCommand = StringUtils.join(commandParts, " ", 1, commandParts.length).toLowerCase(); subCommand = StringUtils.join(commandParts, " ", 1, commandParts.length).toLowerCase();
} }