diff --git a/Essentials/src/main/java/com/earth2me/essentials/commands/Commandexp.java b/Essentials/src/main/java/com/earth2me/essentials/commands/Commandexp.java index c104c43646d..116dc2b320f 100644 --- a/Essentials/src/main/java/com/earth2me/essentials/commands/Commandexp.java +++ b/Essentials/src/main/java/com/earth2me/essentials/commands/Commandexp.java @@ -147,15 +147,21 @@ protected List getTabCompleteOptions(final Server server, final User use } return options; } else if (args.length == 2) { - if ((args[0].equalsIgnoreCase("set") && user.isAuthorized("essentials.exp.set")) || (args[0].equalsIgnoreCase("give") && user.isAuthorized("essentials.exp.give")) || (args[0].equalsIgnoreCase("take") && user.isAuthorized("essentials.exp.take"))) { + final ExpCommands cmd; + try { + cmd = ExpCommands.valueOf(args[0].toUpperCase(Locale.ENGLISH)); + } catch (final IllegalArgumentException e) { + return Collections.emptyList(); + } + if (cmd.hasOtherPermission(user)) { + return getPlayers(user); + } + if (cmd.hasPermission(user) && cmd != ExpCommands.SHOW && cmd != ExpCommands.RESET) { final String levellessArg = args[1].toLowerCase(Locale.ENGLISH).replaceAll("l", ""); if (NumberUtil.isInt(levellessArg)) { return Lists.newArrayList(levellessArg + "l"); } } - if (user.isAuthorized("essentials.exp.others")) { - return getPlayers(user); - } } else if (args.length == 3 && !(args[0].equalsIgnoreCase("show") || args[0].equalsIgnoreCase("reset"))) { final String levellessArg = args[2].toLowerCase(Locale.ENGLISH).replaceAll("l", ""); if (NumberUtil.isInt(levellessArg)) { diff --git a/Essentials/src/main/resources/messages.properties b/Essentials/src/main/resources/messages.properties index 85f1d20dc36..8d1b411853b 100644 --- a/Essentials/src/main/resources/messages.properties +++ b/Essentials/src/main/resources/messages.properties @@ -375,9 +375,9 @@ expCommandUsage1Description=Gives the target player the specified amount of xp expCommandUsage2=/ set expCommandUsage2Description=Sets the target player's xp the specified amount expCommandUsage3=/ show -expCommandUsage4Description=Displays the amount of xp the target player has -expCommandUsage5=/ reset -expCommandUsage5Description=Resets the target player's xp to 0 +expCommandUsage3Description=Displays the amount of xp the target player has +expCommandUsage4=/ reset +expCommandUsage4Description=Resets the target player's xp to 0 expSet={0} now has {1} exp. extCommandDescription=Extinguish players. extCommandUsage=/ [player]