From 78f3127dc91528fca25d62e994d8d1baedb36db4 Mon Sep 17 00:00:00 2001 From: ayunami2000 Date: Fri, 8 Apr 2022 02:49:59 -0400 Subject: [PATCH] part DONE --- src/main/java/dev/plex/listener/impl/CommandListener.java | 7 +++---- src/main/resources/commands.yml | 1 + 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/dev/plex/listener/impl/CommandListener.java b/src/main/java/dev/plex/listener/impl/CommandListener.java index 9b6270c..b83a8df 100644 --- a/src/main/java/dev/plex/listener/impl/CommandListener.java +++ b/src/main/java/dev/plex/listener/impl/CommandListener.java @@ -15,6 +15,8 @@ import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; import org.bukkit.event.player.PlayerCommandPreprocessEvent; +import java.util.regex.Matcher; + public class CommandListener extends PlexListener { @EventHandler(priority = EventPriority.HIGHEST) @@ -45,10 +47,7 @@ public class CommandListener extends PlexListener boolean isBlocked = false; if (blockedCommand instanceof RegexCommand regexCommand) { - System.out.println(regexCommand.getRegex()); - System.out.println(message); - System.out.println(regexCommand.getRegex().matcher(message).results()); - if (regexCommand.getRegex().matcher(message).matches()) + if (regexCommand.getRegex().matcher(message).lookingAt()) { isBlocked = true; } diff --git a/src/main/resources/commands.yml b/src/main/resources/commands.yml index 6103b84..e02d092 100644 --- a/src/main/resources/commands.yml +++ b/src/main/resources/commands.yml @@ -17,4 +17,5 @@ # - "r:e:(.*:):Plugin specific commands are disabled" blockedCommands: - "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" \ No newline at end of file