mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2024-11-27 01:05:38 +00:00
Fix commandblocker not blocking properly. Resolves #586
This commit is contained in:
parent
42266c37ea
commit
ea6bfa8387
@ -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
|
||||||
|
@ -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))
|
||||||
{
|
{
|
||||||
|
@ -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();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user