mirror of
https://github.com/plexusorg/Plex.git
synced 2024-12-23 01:27:37 +00:00
part DONE
This commit is contained in:
parent
9bb316b80b
commit
78f3127dc9
@ -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;
|
||||||
}
|
}
|
||||||
|
@ -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"
|
Loading…
Reference in New Issue
Block a user