diff options
| author | Freya Murphy <freya@freyacat.org> | 2026-03-28 23:09:18 -0400 |
|---|---|---|
| committer | Freya Murphy <freya@freyacat.org> | 2026-03-28 23:09:18 -0400 |
| commit | 2352b5324ae1f7a37361f067de836c3da6b1f1e5 (patch) | |
| tree | 4153b8c74f84dffc9863d29c12d253a2ca857463 /core/src/command/map | |
| parent | add wiki (diff) | |
| download | kenshinshideandseek2-2352b5324ae1f7a37361f067de836c3da6b1f1e5.tar.gz kenshinshideandseek2-2352b5324ae1f7a37361f067de836c3da6b1f1e5.tar.bz2 kenshinshideandseek2-2352b5324ae1f7a37361f067de836c3da6b1f1e5.zip | |
2.0.0-alpha2v2.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
Diffstat (limited to 'core/src/command/map')
| -rw-r--r-- | core/src/command/map/blockhunt/Disguise.kt | 31 | ||||
| -rw-r--r-- | core/src/command/map/blockhunt/block/Add.kt | 2 |
2 files changed, 32 insertions, 1 deletions
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<String>) { + 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<String> = + 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() } } |