9
0
mirror of https://github.com/Auxilor/EcoSkills.git synced 2026-01-03 06:12:21 +00:00

Fixed tabcompletion

This commit is contained in:
Auxilor
2022-11-19 19:55:10 +00:00
parent bebef17f01
commit d18df2bab7

View File

@@ -6,6 +6,7 @@ import com.willfp.ecoskills.gui.SkillGUI
import com.willfp.ecoskills.skills.Skills
import org.bukkit.command.CommandSender
import org.bukkit.entity.Player
import org.bukkit.util.StringUtil
class CommandSkills(plugin: EcoPlugin) :
PluginCommand(
@@ -42,4 +43,19 @@ class CommandSkills(plugin: EcoPlugin) :
skill.gui.menu.open(sender)
}
override fun tabComplete(sender: CommandSender, args: List<String>): List<String> {
val completions = mutableListOf<String>()
if (args.size == 1) {
StringUtil.copyPartialMatches(
args[0],
Skills.values().map { it.id },
completions
)
return completions
}
return emptyList()
}
}