From f8322cd21cde68a72b05efbad3a05b8e67c0bdd0 Mon Sep 17 00:00:00 2001 From: Freya Murphy Date: Thu, 26 Mar 2026 23:15:33 -0400 Subject: initial --- core/src/command/map/Status.kt | 45 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 core/src/command/map/Status.kt (limited to 'core/src/command/map/Status.kt') diff --git a/core/src/command/map/Status.kt b/core/src/command/map/Status.kt new file mode 100644 index 0000000..596f306 --- /dev/null +++ b/core/src/command/map/Status.kt @@ -0,0 +1,45 @@ +package cat.freya.khs.command.map + +import cat.freya.khs.Khs +import cat.freya.khs.command.util.Command +import cat.freya.khs.player.Player +import cat.freya.khs.runChecks + +class KhsMapStatus : Command { + override val label = "status" + override val usage = listOf("map") + override val description = "Says what is needed to fully setup the map" + + override fun execute(plugin: Khs, player: Player, args: List) { + val (name) = args + runChecks(plugin, player) { mapExists(name) } + + val map = plugin.maps.get(name) ?: return + + if (map.setup) { + player.message(plugin.locale.prefix.default + plugin.locale.map.setup.complete) + return + } + + player.message( + buildString { + appendLine(plugin.locale.map.setup.header) + if (map.gameSpawn == null) appendLine(plugin.locale.map.setup.game) + if (map.lobbySpawn == null) appendLine(plugin.locale.map.setup.lobby) + if (map.seekerLobbySpawn == null) appendLine(plugin.locale.map.setup.seekerLobby) + if (plugin.config.exit == null) appendLine(plugin.locale.map.setup.exit) + if (map.bounds() == null) appendLine(plugin.locale.map.setup.bounds) + if (plugin.config.mapSaveEnabled && !map.hasMapSave()) + appendLine(plugin.locale.map.setup.saveMap) + if (map.config.blockHunt.enabled && map.config.blockHunt.blocks.isEmpty()) + appendLine(plugin.locale.map.setup.blockHunt) + } + ) + } + + override fun autoComplete(plugin: Khs, parameter: String, typed: String): List = + when (parameter) { + "map" -> plugin.maps.keys.filter { it.startsWith(typed) } + else -> listOf() + } +} -- cgit v1.2.3-freya