From 2352b5324ae1f7a37361f067de836c3da6b1f1e5 Mon Sep 17 00:00:00 2001 From: Freya Murphy Date: Sat, 28 Mar 2026 23:09:18 -0400 Subject: 2.0.0-alpha2 - Added command /hs map blockhunt disguise - Auto complete block names in blockhunt commands - Fixed void generating chunks in non map save worlds - Fixed onDamage having no attacker - Fixed onDamage not respawning seeker properly - Fixed config deserialize not handeling nulls - Fixed config deserialize looking at more properties then it should --- core/src/command/map/blockhunt/Disguise.kt | 31 +++++++++++++++++++++++++++++ core/src/command/map/blockhunt/block/Add.kt | 2 +- 2 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 core/src/command/map/blockhunt/Disguise.kt (limited to 'core/src/command/map') diff --git a/core/src/command/map/blockhunt/Disguise.kt b/core/src/command/map/blockhunt/Disguise.kt new file mode 100644 index 0000000..8ee715a --- /dev/null +++ b/core/src/command/map/blockhunt/Disguise.kt @@ -0,0 +1,31 @@ +package cat.freya.khs.command.map.blockhunt.block + +import cat.freya.khs.Khs +import cat.freya.khs.command.util.Command +import cat.freya.khs.player.Player +import cat.freya.khs.runChecks + +class KhsMapBlockHuntDisguise : Command { + override val label = "disguise" + override val usage = listOf("block") + override val description = "Disguise oneself as any block" + + override fun execute(plugin: Khs, player: Player, args: List) { + val (blockName) = args + runChecks(plugin, player) { blockHuntSupported() } + + val material = plugin.shim.parseMaterial(blockName) + if (material == null) { + player.message(plugin.locale.prefix.error + plugin.locale.blockHunt.block.unknown) + return + } + + player.disguise(material) + } + + override fun autoComplete(plugin: Khs, parameter: String, typed: String): List = + when (parameter) { + "block" -> plugin.shim.blocks.filter { it.startsWith(typed) } + else -> listOf() + } +} diff --git a/core/src/command/map/blockhunt/block/Add.kt b/core/src/command/map/blockhunt/block/Add.kt index 6ed17be..c39cee9 100644 --- a/core/src/command/map/blockhunt/block/Add.kt +++ b/core/src/command/map/blockhunt/block/Add.kt @@ -49,7 +49,7 @@ class KhsMapBlockHuntBlockAdd : Command { .filter { it.value.config.blockHunt.enabled } .map { it.key } .filter { it.startsWith(typed) } - "block" -> listOf(parameter) + "block" -> plugin.shim.blocks.filter { it.startsWith(typed) } else -> listOf() } } -- cgit v1.2.3-freya