part DONE

This commit is contained in:
ayunami2000 2022-04-08 02:49:59 -04:00
parent 9bb316b80b
commit 78f3127dc9
2 changed files with 4 additions and 4 deletions

View File

@ -15,6 +15,8 @@ import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority; import org.bukkit.event.EventPriority;
import org.bukkit.event.player.PlayerCommandPreprocessEvent; import org.bukkit.event.player.PlayerCommandPreprocessEvent;
import java.util.regex.Matcher;
public class CommandListener extends PlexListener public class CommandListener extends PlexListener
{ {
@EventHandler(priority = EventPriority.HIGHEST) @EventHandler(priority = EventPriority.HIGHEST)
@ -45,10 +47,7 @@ public class CommandListener extends PlexListener
boolean isBlocked = false; boolean isBlocked = false;
if (blockedCommand instanceof RegexCommand regexCommand) if (blockedCommand instanceof RegexCommand regexCommand)
{ {
System.out.println(regexCommand.getRegex()); if (regexCommand.getRegex().matcher(message).lookingAt())
System.out.println(message);
System.out.println(regexCommand.getRegex().matcher(message).results());
if (regexCommand.getRegex().matcher(message).matches())
{ {
isBlocked = true; isBlocked = true;
} }

View File

@ -17,4 +17,5 @@
# - "r:e:(.*:):Plugin specific commands are disabled" # - "r:e:(.*:):Plugin specific commands are disabled"
blockedCommands: blockedCommands:
- "m:e:mail sendall:You cannot send messages to everyone on the server" - "m:e:mail sendall:You cannot send messages to everyone on the server"
- "m:e:mail sendtempall:You cannot send messages to everyone on the server"
- "r:e:^[^ ]+::Plugin specific commands are disabled" - "r:e:^[^ ]+::Plugin specific commands are disabled"