Fix XP command tab completion suggesting skill names for the value argument

This commit is contained in:
nossr50
2026-07-11 15:52:11 -07:00
parent d305d5254a
commit 9cae4d9de7

View File

@ -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()));