Fix mmoinfo command

This commit is contained in:
nossr50
2019-09-23 13:20:42 -07:00
parent ef25385786
commit efbd9d52c3
2 changed files with 28 additions and 7 deletions

View File

@@ -1,6 +1,5 @@
package com.gmail.nossr50.commands.skills;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.gmail.nossr50.datatypes.skills.SubSkillType;
import com.gmail.nossr50.datatypes.skills.subskills.AbstractSubSkill;
import com.gmail.nossr50.listeners.InteractionManager;
@@ -46,7 +45,7 @@ public class MmoInfoCommand implements TabExecutor {
player.sendMessage(pluginRef.getLocaleManager().getString("Commands.MmoInfo.DetailsHeader"));
player.sendMessage(pluginRef.getLocaleManager().getString("Commands.MmoInfo.Mystery"));
return true;
} else if (InteractionManager.getAbstractByName(args[0]) != null || PrimarySkillType.SUBSKILL_NAMES.contains(args[0])) {
} else if (InteractionManager.getAbstractByName(args[0]) != null || pluginRef.getSkillTools().isSubSkillNameExact(args[0])) {
displayInfo(player, args[0]);
return true;
}
@@ -64,7 +63,7 @@ public class MmoInfoCommand implements TabExecutor {
public List<String> onTabComplete(CommandSender sender, Command command, String alias, String[] args) {
switch (args.length) {
case 1:
return StringUtil.copyPartialMatches(args[0], PrimarySkillType.SUBSKILL_NAMES, new ArrayList<>(PrimarySkillType.SUBSKILL_NAMES.size()));
return StringUtil.copyPartialMatches(args[0], pluginRef.getSkillTools().EXACT_SUBSKILL_NAMES, new ArrayList<>(pluginRef.getSkillTools().EXACT_SUBSKILL_NAMES.size()));
default:
return ImmutableList.of();
}