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..547246377f6 100644 --- a/Essentials/src/main/java/com/earth2me/essentials/commands/Commandexp.java +++ b/Essentials/src/main/java/com/earth2me/essentials/commands/Commandexp.java @@ -147,13 +147,17 @@ 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 String subCmd = args[0].toLowerCase(Locale.ENGLISH); + final boolean isModifyCmd = (subCmd.equals("set") && user.isAuthorized("essentials.exp.set")) || (subCmd.equals("give") && user.isAuthorized("essentials.exp.give")) || (subCmd.equals("take") && user.isAuthorized("essentials.exp.take")); + final boolean hasOthers = (subCmd.equals("set") && user.isAuthorized("essentials.exp.set.others")) || (subCmd.equals("give") && user.isAuthorized("essentials.exp.give.others")) || (subCmd.equals("take") && user.isAuthorized("essentials.exp.take.others")) || (subCmd.equals("show") && user.isAuthorized("essentials.exp.others")) || (subCmd.equals("reset") && user.isAuthorized("essentials.exp.reset.others")); + if (isModifyCmd && !hasOthers) { final String levellessArg = args[1].toLowerCase(Locale.ENGLISH).replaceAll("l", ""); if (NumberUtil.isInt(levellessArg)) { return Lists.newArrayList(levellessArg + "l"); } + return Collections.emptyList(); } - if (user.isAuthorized("essentials.exp.others")) { + if (hasOthers) { return getPlayers(user); } } else if (args.length == 3 && !(args[0].equalsIgnoreCase("show") || args[0].equalsIgnoreCase("reset"))) { diff --git a/Essentials/src/main/resources/messages.properties b/Essentials/src/main/resources/messages.properties index 85f1d20dc36..5acf798040c 100644 --- a/Essentials/src/main/resources/messages.properties +++ b/Essentials/src/main/resources/messages.properties @@ -375,7 +375,7 @@ 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 +expCommandUsage3Description=Displays the amount of xp the target player has expCommandUsage5=/ reset expCommandUsage5Description=Resets the target player's xp to 0 expSet={0} now has {1} exp. diff --git a/Essentials/src/main/resources/messages_ru.properties b/Essentials/src/main/resources/messages_ru.properties index 250f0a98a2a..6ba934e2b4a 100644 --- a/Essentials/src/main/resources/messages_ru.properties +++ b/Essentials/src/main/resources/messages_ru.properties @@ -375,7 +375,7 @@ expCommandUsage1Description=Выдаёт указанному игроку за expCommandUsage2=/ set <игрок> <кол-во> expCommandUsage2Description=Устанавливает опыт игрока на указанное количество expCommandUsage3=/ show <игрок> -expCommandUsage4Description=Отображает количество опыта указанного игрока +expCommandUsage3Description=Отображает количество опыта указанного игрока expCommandUsage5=/ reset <игрок> expCommandUsage5Description=Сбрасывает опыт указанного игрока expSet={0} теперь имеет {1} опыта.