From 2d2d12a549fb27e6249b333f015547920e741360 Mon Sep 17 00:00:00 2001 From: BuildTools Date: Sun, 2 Jul 2023 02:01:31 +1000 Subject: [PATCH] added debug command permission --- src/main/java/com/gmail/nossr50/util/Permissions.java | 1 + .../gmail/nossr50/util/commands/CommandRegistrationManager.java | 2 +- src/main/resources/plugin.yml | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/gmail/nossr50/util/Permissions.java b/src/main/java/com/gmail/nossr50/util/Permissions.java index c405f84ab..4cfe85c43 100644 --- a/src/main/java/com/gmail/nossr50/util/Permissions.java +++ b/src/main/java/com/gmail/nossr50/util/Permissions.java @@ -44,6 +44,7 @@ public final class Permissions { */ public static boolean mmoinfo(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.mmoinfo"); } + public static boolean mmodebug(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.mmodebug"); } public static boolean addlevels(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.addlevels"); } public static boolean addlevelsOthers(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.addlevels.others"); } diff --git a/src/main/java/com/gmail/nossr50/util/commands/CommandRegistrationManager.java b/src/main/java/com/gmail/nossr50/util/commands/CommandRegistrationManager.java index 83d305486..6510604e9 100644 --- a/src/main/java/com/gmail/nossr50/util/commands/CommandRegistrationManager.java +++ b/src/main/java/com/gmail/nossr50/util/commands/CommandRegistrationManager.java @@ -160,7 +160,7 @@ public final class CommandRegistrationManager { private static void registerMmoDebugCommand() { PluginCommand command = mcMMO.p.getCommand("mmodebug"); command.setDescription(LocaleLoader.getString("Commands.Description.mmodebug")); - command.setPermission(null); //No perm required to save support headaches + command.setPermission("mcmmo.commands.mmodebug"); command.setPermissionMessage(permissionsMessage); command.setUsage(LocaleLoader.getString("Commands.Usage.0", "mmodebug")); command.setExecutor(new PlayerDebugCommand()); diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index fec5c78c2..69cb8b10b 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -30,6 +30,7 @@ commands: mmodebug: aliases: [mcmmodebugmode] description: Toggles a debug mode which will print useful information to chat + permission: mcmmo.commands.mmodebug mmoinfo: aliases: [mcinfo] description: Info pages for mcMMO