update from v1.x.x

This commit is contained in:
alexcrea 2026-07-08 03:58:03 +02:00
parent 5a6962b1c4
commit 13892f73b8
Signed by: alexcrea
GPG key ID: E59DF23EE2A2266C
3 changed files with 7 additions and 12 deletions

View file

@ -23,7 +23,7 @@ interface CASubCommand {
fun description(): String
protected fun allEnchantmentsByName(): Collection<String> {
fun allEnchantmentsByName(): Collection<String> {
val names = mutableSetOf<String>()
for (enchantment in CAEnchantmentRegistry.getInstance().values()) {
names.add(enchantment.name)

View file

@ -20,6 +20,10 @@ class EditConfigExecutor : CASubCommand {
return sender.hasPermission(CustomAnvil.editConfigPermission)
}
override fun description(): String {
return "Gui to edit the plugin's config"
}
override fun executeCommand(
sender: CommandSender,
cmd: Command,
@ -68,7 +72,7 @@ class EditConfigExecutor : CASubCommand {
return
}
} else {
enchantToFilter = HashSet(EnchantmentApi.getListByName(args[1].lowercase()))
enchantToFilter = HashSet(EnchantmentApi.getByName(args[1].lowercase()))
if (enchantToFilter.isEmpty()) {
sender.sendMessage("No enchantment found with the name \"${args[1]}\"")
@ -112,15 +116,6 @@ class EditConfigExecutor : CASubCommand {
else -> listOf()
}
)
override fun tabCompleter(
sender: CommandSender,
args: Array<out String>,
list: MutableList<String>
) {
}
override fun description(): String {
return "Gui to edit the plugin's config"
}
}

View file

@ -12,7 +12,7 @@ import xyz.alexcrea.cuanvil.api.EnchantmentApi
import xyz.alexcrea.cuanvil.enchant.CAEnchantment
import xyz.alexcrea.cuanvil.util.MaterialUtil.isAir
class EnchantExecutor : CASubCommand() {
class EnchantExecutor : CASubCommand {
override fun allowed(sender: CommandSender): Boolean {