Added "/co page" alias command for page lookups

This commit is contained in:
Intelli 2022-02-03 20:18:17 -07:00
parent b0d14f4d2b
commit 2c8e289c43
2 changed files with 7 additions and 2 deletions

View File

@ -1107,7 +1107,7 @@ public class CommandHandler implements CommandExecutor {
else if (user.hasPermission("coreprotect.purge") && corecommand.equals("purge")) { else if (user.hasPermission("coreprotect.purge") && corecommand.equals("purge")) {
permission = true; permission = true;
} }
else if (user.hasPermission("coreprotect.lookup") && (corecommand.equals("l") || corecommand.equals("lookup") || corecommand.equals("near"))) { else if (user.hasPermission("coreprotect.lookup") && (corecommand.equals("l") || corecommand.equals("lookup") || corecommand.equals("page") || corecommand.equals("near"))) {
permission = true; permission = true;
} }
else if (user.hasPermission("coreprotect.lookup.near") && corecommand.equals("near")) { else if (user.hasPermission("coreprotect.lookup.near") && corecommand.equals("near")) {
@ -1145,7 +1145,7 @@ public class CommandHandler implements CommandExecutor {
else if (corecommand.equals("inspect") || corecommand.equals("i")) { else if (corecommand.equals("inspect") || corecommand.equals("i")) {
InspectCommand.runCommand(user, permission, argumentArray); InspectCommand.runCommand(user, permission, argumentArray);
} }
else if (corecommand.equals("lookup") || corecommand.equals("l")) { else if (corecommand.equals("lookup") || corecommand.equals("l") || corecommand.equals("page")) {
LookupCommand.runCommand(user, command, permission, argumentArray); LookupCommand.runCommand(user, command, permission, argumentArray);
} }
else if (corecommand.equals("near")) { else if (corecommand.equals("near")) {

View File

@ -63,6 +63,11 @@ public class LookupCommand {
return; return;
} }
if (args[0].toLowerCase(Locale.ROOT).equals("page") && (args.length != 2 || !args[1].equals(args[1].replaceAll("[^0-9]", "")))) {
Chat.sendMessage(player, Color.DARK_AQUA + "CoreProtect " + Color.WHITE + "- " + Phrase.build(Phrase.MISSING_PARAMETERS, Color.WHITE, "/co page <page>"));
return;
}
int argExcluded = argExclude.size(); int argExcluded = argExclude.size();
int argRestricted = argBlocks.size(); int argRestricted = argBlocks.size();