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

@ -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);
}
command = command.toLowerCase().trim();
// Blocked commands
if (TFM_CommandBlocker.isCommandBlocked(command, event.getPlayer(), true))
{

View File

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