Be more specific with the command blocker

This commit is contained in:
Telesphoreo 2022-05-25 23:10:20 -05:00
parent d785ef31c8
commit 53cd4b1306
3 changed files with 3 additions and 4 deletions

View file

@ -120,7 +120,7 @@ public class Plex extends PlexPlugin implements PlexApiProvider
messages.load();
toggles.load();
// Don't add default entries to indefinite ban file
// Don't add default entries to these files
indefBans.load(false);
commands.load(false);

View file

@ -75,9 +75,8 @@ public class CommandListener extends PlexListener
String[] commandArgs = blockedCommand.getCommand().split(" ");
if (arguments.toLowerCase(Locale.ROOT).startsWith(StringUtils.join(commandArgs, " ", 1, commandArgs.length).toLowerCase(Locale.ROOT)))
{
PlexLog.debug("Player attempted to use a blocked command with an alias.");
PlexLog.debug("Player attempted to use a blocked command with alias of normal command: " + blockedCommand.getCommand());
cmdRef.set(blockedCommand);
return;
}
}
});

View file

@ -10,7 +10,7 @@
# - The ranks are "e" for everyone, "s" for senior admin, and "a" for admin
# - MATCHING MODE: The command is just the command without slashes. Optional arguments are specified as well. It also accepts full plugins via specifying the plugin name followed by a ":" (e.g. "viaversion:")
# - REGEX MODE: The command is regex that matches the desired command. It matches case insensitively.
# - Finally the block message. MUST NOT CONTAIN ":". Use _ to use the default command blocked message as specified in messages.yml, or you can optionally put your own in
# - Finally the block message MUST NOT CONTAIN ":". Use _ to use the default command blocked message as specified in messages.yml, or you can optionally put your own in
#
# So these would be valid:
# - "m:e:mail sendall:You cannot send messages to everyone on the server"