diff --git a/commons/src/main/java/me/totalfreedom/totalfreedommod/blocking/command/CommandBlocker.java b/commons/src/main/java/me/totalfreedom/totalfreedommod/blocking/command/CommandBlocker.java index 925ee64f..46b2e4d6 100644 --- a/commons/src/main/java/me/totalfreedom/totalfreedommod/blocking/command/CommandBlocker.java +++ b/commons/src/main/java/me/totalfreedom/totalfreedommod/blocking/command/CommandBlocker.java @@ -24,7 +24,7 @@ import org.bukkit.plugin.SimplePluginManager; public class CommandBlocker extends FreedomService { - + private final Pattern whitespacePattern = Pattern.compile("^/?( +)(.*)?"); private final Pattern flagPattern = Pattern.compile("(:([0-9]){5,})"); // private final Map entryList = Maps.newHashMap(); @@ -157,6 +157,14 @@ public class CommandBlocker extends FreedomService // Format command = command.toLowerCase().trim(); + + // Whitespaces + Matcher whitespaceMatcher = whitespacePattern.matcher(command); + if (whitespaceMatcher.matches() && whitespaceMatcher.groupCount() == 2) + { + command = whitespaceMatcher.group(2); + } + command = command.startsWith("/") ? command.substring(1) : command; // Check for plugin specific commands diff --git a/pom.xml b/pom.xml index 890689b8..4d58e05c 100644 --- a/pom.xml +++ b/pom.xml @@ -13,6 +13,7 @@ discord + UTF-8 Caladrius