diff --git a/src/main/java/com/gmail/nossr50/commands/general/XprateCommand.java b/src/main/java/com/gmail/nossr50/commands/general/XprateCommand.java index 167a7ac77..d533d5c7b 100644 --- a/src/main/java/com/gmail/nossr50/commands/general/XprateCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/general/XprateCommand.java @@ -20,7 +20,9 @@ public class XprateCommand implements CommandExecutor { String usage2 = LocaleLoader.getString("Commands.xprate.proper.1"); String usage3 = LocaleLoader.getString("Commands.xprate.proper.2"); - if (CommandHelper.noCommandPermissions(sender, "mcmmo.admin")) { + // DEPRECATED PERMISSION + boolean oldPermission = !CommandHelper.noCommandPermissions(sender, "mcmmo.admin"); + if (!oldPermission && CommandHelper.noCommandPermissions(sender, "mcmmo.commands.xprate")) { return true; } @@ -29,6 +31,10 @@ public class XprateCommand implements CommandExecutor { switch (args.length) { case 1: if (args[0].equalsIgnoreCase("reset")) { + if (!oldPermission && CommandHelper.noCommandPermissions(sender, "mcmmo.commands.xprate.reset")) { + return true; + } + if (xpEventEnabled) { for (Player x : mcMMO.p.getServer().getOnlinePlayers()) { x.sendMessage(LocaleLoader.getString("Commands.xprate.over")); @@ -52,6 +58,9 @@ public class XprateCommand implements CommandExecutor { case 2: if (Misc.isInt(args[0])) { + if (!oldPermission && CommandHelper.noCommandPermissions(sender, "mcmmo.commands.xprate.set")) { + return true; + } if (args[1].equalsIgnoreCase("true") || args[1].equalsIgnoreCase("false")) { mcMMO.p.setXPEventEnabled(Boolean.valueOf(args[1])); } diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index 5665a957b..e7803b738 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -712,6 +712,7 @@ permissions: mcmmo.commands.mmoedit.others: true mcmmo.commands.mmoupdate: true mcmmo.commands.skillreset.all: true + mcmmo.commands.xprate: true mcmmo.commands.defaults: description: Implies all default mcmmo.commands permissions. children: @@ -907,6 +908,22 @@ permissions: description: Allows access to the skillreset command for unarmed mcmmo.commands.skillreset.woodcutting: description: Allows access to the skillreset command for woodcutting + mcmmo.commands.xprate.*: + description: Implies access to all mcmmo.commands.inspect permissions + children: + mcmmo.commands.xprate.all: true + mcmmo.commands.xprate.all: + description: Implies access to all mcmmo.commands.inspect permissions + children: + mcmmo.commands.xprate: true + mcmmo.commands.xprate.reset: true + mcmmo.commands.xprate.set: true + mcmmo.commands.xprate: + description: Allows access to the xprate command + mcmmo.commands.xprate.reset: + description: Allows access to the xprate reset command + mcmmo.commands.xprate.set: + description: Allows access to the xprate command to control xp events mcmmo.chat.*: description: Implies all mcmmo.chat permissions. (Warning, contains adminchat) children: