From bcaa7ecacbc3d6624f52d0fb6dcbc5e9103a3ae7 Mon Sep 17 00:00:00 2001 From: "U-YUE\\Sean" Date: Wed, 30 Jan 2013 09:55:22 -0800 Subject: [PATCH] Added new permissions for the /mmoedit command. --- .../gmail/nossr50/commands/general/MmoeditCommand.java | 8 +++++++- src/main/resources/plugin.yml | 8 ++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/gmail/nossr50/commands/general/MmoeditCommand.java b/src/main/java/com/gmail/nossr50/commands/general/MmoeditCommand.java index 9d6f3621d..41061a299 100644 --- a/src/main/java/com/gmail/nossr50/commands/general/MmoeditCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/general/MmoeditCommand.java @@ -21,9 +21,11 @@ public class MmoeditCommand implements CommandExecutor { int newValue; SkillType skill; String skillName; + // DEPRECATED PERMISSION + boolean oldPermission = !CommandHelper.noCommandPermissions(sender, "mcmmo.tools.mmoedit"); String usage = LocaleLoader.getString("Commands.Usage.3", new Object[] {"mmoedit", "[" + LocaleLoader.getString("Commands.Usage.Player") + "]", "<" + LocaleLoader.getString("Commands.Usage.Skill") + ">", "<" + LocaleLoader.getString("Commands.Usage.Level") + ">" }); - if (CommandHelper.noCommandPermissions(sender, "mcmmo.tools.mmoedit")) { + if (!oldPermission && CommandHelper.noCommandPermissions(sender, "mcmmo.commands.mmoedit")) { return true; } @@ -62,6 +64,10 @@ public class MmoeditCommand implements CommandExecutor { return true; case 3: + if (!oldPermission && CommandHelper.noCommandPermissions(sender, "mcmmo.commands.mmoedit.others")) { + return true; + } + if (!Misc.isInt(args[2])) { sender.sendMessage(usage); return true; diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index 8bf78e758..e5300ae15 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -702,6 +702,10 @@ permissions: mcmmo.commands.addxp: true mcmmo.commands.addxp.others: true mcmmo.commands.defaults: true + mcmmo.commands.inspect.far: true + mcmmo.commands.inspect.offline: true + mcmmo.commands.mmoedit: true + mcmmo.commands.mmoedit.others: true mcmmo.commands.defaults: description: Implies all default mcmmo.commands permissions. children: @@ -736,6 +740,10 @@ permissions: description: Allows access to the inspect command for far players mcmmo.commands.inspect.offline: description: Allows access to the inspect command for offline players + mcmmo.commands.mmoedit: + description: Allows access to the addlevels command + mcmmo.commands.mmoedit.others: + description: Allows access to the addlevels command for other players mcmmo.commands.party.*: description: Implies access to all mcmmo.commands.party permissions. children: