mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2026-08-18 11:26:06 +00:00
Fix XP command tab completion suggesting skill names for the value argument
This commit is contained in:
@ -145,6 +145,13 @@ public abstract class ExperienceCommand implements TabExecutor {
|
||||
return StringUtil.copyPartialMatches(args[0], playerNames,
|
||||
new ArrayList<>(playerNames.size()));
|
||||
case 2:
|
||||
// Self-targeting form like '/mmoedit all 1000': when the first argument is
|
||||
// already a skill (or 'all'), the next argument is a number, not a skill
|
||||
if (args[0].equalsIgnoreCase("all")
|
||||
|| mcMMO.p.getSkillTools().matchSkill(args[0]) != null) {
|
||||
return ImmutableList.of();
|
||||
}
|
||||
|
||||
return StringUtil.copyPartialMatches(args[1],
|
||||
mcMMO.p.getSkillTools().LOCALIZED_SKILL_NAMES,
|
||||
new ArrayList<>(mcMMO.p.getSkillTools().LOCALIZED_SKILL_NAMES.size()));
|
||||
|
||||
Reference in New Issue
Block a user