Merge branch 'RELEASE-2023.03' into proper-resultset-retrieval

This commit is contained in:
Paul Reilly 2023-03-31 21:35:30 -05:00
commit 8b48408870
2 changed files with 10 additions and 1 deletions

View File

@ -24,7 +24,7 @@ import org.bukkit.plugin.SimplePluginManager;
public class CommandBlocker extends FreedomService public class CommandBlocker extends FreedomService
{ {
private final Pattern whitespacePattern = Pattern.compile("^/?( +)(.*)?");
private final Pattern flagPattern = Pattern.compile("(:([0-9]){5,})"); private final Pattern flagPattern = Pattern.compile("(:([0-9]){5,})");
// //
private final Map<String, CommandBlockerEntry> entryList = Maps.newHashMap(); private final Map<String, CommandBlockerEntry> entryList = Maps.newHashMap();
@ -157,6 +157,14 @@ public class CommandBlocker extends FreedomService
// Format // Format
command = command.toLowerCase().trim(); 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; command = command.startsWith("/") ? command.substring(1) : command;
// Check for plugin specific commands // Check for plugin specific commands

View File

@ -13,6 +13,7 @@
<module>discord</module> <module>discord</module>
</modules> </modules>
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<tfm.build.codename>Caladrius</tfm.build.codename> <tfm.build.codename>Caladrius</tfm.build.codename>