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/SetExit.kt | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 core/src/command/SetExit.kt (limited to 'core/src/command/SetExit.kt') diff --git a/core/src/command/SetExit.kt b/core/src/command/SetExit.kt new file mode 100644 index 0000000..d3feb2c --- /dev/null +++ b/core/src/command/SetExit.kt @@ -0,0 +1,25 @@ +package cat.freya.khs.command + +import cat.freya.khs.Khs +import cat.freya.khs.command.util.Command +import cat.freya.khs.player.Player +import cat.freya.khs.runChecks + +class KhsSetExit : Command { + override val label = "setexit" + override val usage = listOf() + override val description = "Sets the plugins's exit location" + + override fun execute(plugin: Khs, player: Player, args: List) { + runChecks(plugin, player) { gameNotInProgress() } + + plugin.config.exit = player.location + plugin.saveConfig() + + player.message(plugin.locale.prefix.default + plugin.locale.map.set.exit) + } + + override fun autoComplete(plugin: Khs, parameter: String, typed: String): List { + return listOf() + } +} -- cgit v1.2.3-freya