mirror of
https://github.com/alexcrea/CustomAnvil.git
synced 2026-08-28 08:25:56 +02:00
update from v1.x.x
This commit is contained in:
parent
5a6962b1c4
commit
13892f73b8
3 changed files with 7 additions and 12 deletions
|
|
@ -23,7 +23,7 @@ interface CASubCommand {
|
||||||
|
|
||||||
fun description(): String
|
fun description(): String
|
||||||
|
|
||||||
protected fun allEnchantmentsByName(): Collection<String> {
|
fun allEnchantmentsByName(): Collection<String> {
|
||||||
val names = mutableSetOf<String>()
|
val names = mutableSetOf<String>()
|
||||||
for (enchantment in CAEnchantmentRegistry.getInstance().values()) {
|
for (enchantment in CAEnchantmentRegistry.getInstance().values()) {
|
||||||
names.add(enchantment.name)
|
names.add(enchantment.name)
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,10 @@ class EditConfigExecutor : CASubCommand {
|
||||||
return sender.hasPermission(CustomAnvil.editConfigPermission)
|
return sender.hasPermission(CustomAnvil.editConfigPermission)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun description(): String {
|
||||||
|
return "Gui to edit the plugin's config"
|
||||||
|
}
|
||||||
|
|
||||||
override fun executeCommand(
|
override fun executeCommand(
|
||||||
sender: CommandSender,
|
sender: CommandSender,
|
||||||
cmd: Command,
|
cmd: Command,
|
||||||
|
|
@ -68,7 +72,7 @@ class EditConfigExecutor : CASubCommand {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
enchantToFilter = HashSet(EnchantmentApi.getListByName(args[1].lowercase()))
|
enchantToFilter = HashSet(EnchantmentApi.getByName(args[1].lowercase()))
|
||||||
|
|
||||||
if (enchantToFilter.isEmpty()) {
|
if (enchantToFilter.isEmpty()) {
|
||||||
sender.sendMessage("No enchantment found with the name \"${args[1]}\"")
|
sender.sendMessage("No enchantment found with the name \"${args[1]}\"")
|
||||||
|
|
@ -112,15 +116,6 @@ class EditConfigExecutor : CASubCommand {
|
||||||
else -> listOf()
|
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"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ import xyz.alexcrea.cuanvil.api.EnchantmentApi
|
||||||
import xyz.alexcrea.cuanvil.enchant.CAEnchantment
|
import xyz.alexcrea.cuanvil.enchant.CAEnchantment
|
||||||
import xyz.alexcrea.cuanvil.util.MaterialUtil.isAir
|
import xyz.alexcrea.cuanvil.util.MaterialUtil.isAir
|
||||||
|
|
||||||
class EnchantExecutor : CASubCommand() {
|
class EnchantExecutor : CASubCommand {
|
||||||
|
|
||||||
|
|
||||||
override fun allowed(sender: CommandSender): Boolean {
|
override fun allowed(sender: CommandSender): Boolean {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue