mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2024-12-28 12:47:36 +00:00
Merge pull request #314 from AtlasMediaGroup/merge-main-to-dev
Merge main to dev
This commit is contained in:
commit
1c096b97e3
2
pom.xml
2
pom.xml
@ -5,7 +5,7 @@
|
||||
|
||||
<groupId>me.totalfreedom</groupId>
|
||||
<artifactId>TotalFreedomMod</artifactId>
|
||||
<version>2022.06</version>
|
||||
<version>2022.06.1</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<properties>
|
||||
|
@ -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<String, CommandBlockerEntry> entryList = Maps.newHashMap();
|
||||
@ -156,6 +156,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
|
||||
|
Loading…
Reference in New Issue
Block a user