Add tab completion to /warp
This commit is contained in:
@@ -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
|
||||
|
||||
17
src/main/kotlin/moe/nea/firmament/events/MaskCommands.kt
Normal file
17
src/main/kotlin/moe/nea/firmament/events/MaskCommands.kt
Normal file
@@ -0,0 +1,17 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2023 Linnea Gräf <nea@nea.moe>
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
|
||||
package moe.nea.firmament.events
|
||||
|
||||
import com.mojang.brigadier.CommandDispatcher
|
||||
|
||||
data class MaskCommands(val dispatcher: CommandDispatcher<*>) : FirmamentEvent() {
|
||||
companion object : FirmamentEventBus<MaskCommands>()
|
||||
|
||||
fun mask(name: String) {
|
||||
dispatcher.root.children.removeIf { it.name.equals(name, ignoreCase = true) }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user