Add tab completion to /warp

This commit is contained in:
nea
2023-10-21 17:28:00 +02:00
parent bc758d17e2
commit e887067b7e
12 changed files with 146 additions and 23 deletions

View File

@@ -16,9 +16,15 @@ import moe.nea.firmament.commands.literal
data class CommandEvent(
val dispatcher: CommandDispatcher<DefaultSource>,
val ctx: CommandRegistryAccess,
val serverCommands: CommandDispatcher<*>?,
) : FirmamentEvent() {
companion object : FirmamentEventBus<CommandEvent>()
fun deleteCommand(name: String) {
dispatcher.root.children.removeIf { it.name.equals(name, ignoreCase = false) }
serverCommands?.root?.children?.removeIf { it.name.equals(name, ignoreCase = false) }
}
fun register(
name: String,
block: CaseInsensitiveLiteralCommandNode.Builder<DefaultSource>.() -> Unit