use sendRichMessage instead of creating textComponents

This commit is contained in:
bizink
2025-06-19 01:54:04 +10:00
parent 737ecd638b
commit 53926b020a
10 changed files with 52 additions and 106 deletions

View File

@ -7,8 +7,6 @@ import com.pobnellion.pobutils.Pobutils
import io.papermc.paper.command.brigadier.CommandSourceStack
import io.papermc.paper.command.brigadier.Commands
import io.papermc.paper.plugin.lifecycle.event.types.LifecycleEvents
import net.kyori.adventure.text.Component
import net.kyori.adventure.text.format.NamedTextColor
import org.bukkit.plugin.java.JavaPlugin
@Suppress("UnstableApiUsage")
@ -39,12 +37,12 @@ object CmdModule {
val module = Pobutils.availableModules[moduleName]
if (module == null) {
ctx.source.sender.sendMessage(Component.text("No module named '$moduleName'", NamedTextColor.RED))
ctx.source.sender.sendRichMessage("<red>No module named '$moduleName'")
return@executes Command.SINGLE_SUCCESS
}
if (Pobutils.isEnabled(moduleName)) {
ctx.source.sender.sendMessage(Component.text("Module '$moduleName' is already enabled", NamedTextColor.RED))
ctx.source.sender.sendRichMessage("<red>Module '$moduleName' is already enabled")
return@executes Command.SINGLE_SUCCESS
}
@ -53,7 +51,7 @@ object CmdModule {
plugin.config.set("modules.$moduleName", true)
plugin.saveConfig()
plugin.server.onlinePlayers.forEach { player -> player.updateCommands() }
ctx.source.sender.sendMessage(Component.text("Module '$moduleName' enabled", NamedTextColor.YELLOW))
ctx.source.sender.sendRichMessage("<yellow>Module '$moduleName' enabled")
return@executes Command.SINGLE_SUCCESS
})
@ -71,12 +69,12 @@ object CmdModule {
val module = Pobutils.availableModules[moduleName]
if (module == null) {
ctx.source.sender.sendMessage(Component.text("No module named '$moduleName'", NamedTextColor.RED))
ctx.source.sender.sendRichMessage("<red>No module named '$moduleName'")
return@executes Command.SINGLE_SUCCESS
}
if (!Pobutils.isEnabled(moduleName)) {
ctx.source.sender.sendMessage(Component.text("Module '$moduleName' is already disabled", NamedTextColor.RED))
ctx.source.sender.sendRichMessage("<red>Module '$moduleName' is already disabled")
return@executes Command.SINGLE_SUCCESS
}
@ -85,7 +83,7 @@ object CmdModule {
plugin.config.set("modules.$moduleName", false)
plugin.saveConfig()
plugin.server.onlinePlayers.forEach { player -> player.updateCommands() }
ctx.source.sender.sendMessage(Component.text("Module '$moduleName' disabled", NamedTextColor.YELLOW))
ctx.source.sender.sendRichMessage("<yellow>Module '$moduleName' disabled")
return@executes Command.SINGLE_SUCCESS
})
@ -103,18 +101,18 @@ object CmdModule {
val module = Pobutils.availableModules[moduleName]
if (module == null) {
ctx.source.sender.sendMessage(Component.text("No module named '$moduleName'", NamedTextColor.RED))
ctx.source.sender.sendRichMessage("<red>No module named '$moduleName'")
return@executes Command.SINGLE_SUCCESS
}
if (!Pobutils.isEnabled(moduleName)) {
ctx.source.sender.sendMessage(Component.text("Module '$moduleName' is not currently enabled", NamedTextColor.RED))
ctx.source.sender.sendRichMessage("<red>Module '$moduleName' is not currently enabled")
return@executes Command.SINGLE_SUCCESS
}
module.reload()
plugin.server.onlinePlayers.forEach { player -> player.updateCommands() }
ctx.source.sender.sendMessage(Component.text("Module '$moduleName' reloaded", NamedTextColor.YELLOW))
ctx.source.sender.sendRichMessage("<yellow>Module '$moduleName' reloaded")
return@executes Command.SINGLE_SUCCESS
})
@ -124,12 +122,8 @@ object CmdModule {
val configCommand = Commands.literal("config")
.executes { ctx ->
for ((name, _) in Pobutils.availableModules) {
val enabledText = if (Pobutils.isEnabled(name))
Component.text("enabled", NamedTextColor.GREEN)
else
Component.text("disabled", NamedTextColor.RED)
ctx.source.sender.sendMessage(Component.text("$name: ", NamedTextColor.YELLOW).append(enabledText))
val enabledText = if (Pobutils.isEnabled(name)) "<green>enabled" else "<red>disabled"
ctx.source.sender.sendRichMessage("<yellow>$name: $enabledText")
}
return@executes Command.SINGLE_SUCCESS
}

View File

@ -5,8 +5,6 @@ import com.mojang.brigadier.arguments.BoolArgumentType
import com.mojang.brigadier.builder.LiteralArgumentBuilder
import io.papermc.paper.command.brigadier.CommandSourceStack
import io.papermc.paper.command.brigadier.Commands
import net.kyori.adventure.text.Component
import net.kyori.adventure.text.format.NamedTextColor
import org.bukkit.plugin.java.JavaPlugin
@Suppress("UnstableApiUsage")
@ -20,15 +18,12 @@ object CmdDisableExplosionsConfig {
disableExplosions.igniteTnt = shouldIgniteTnt
plugin.config.set("data.disableExplosions.igniteTnt", shouldIgniteTnt)
plugin.saveConfig()
ctx.source.sender.sendMessage(Component.text("igniteTnt set to: $shouldIgniteTnt", NamedTextColor.YELLOW))
ctx.source.sender.sendRichMessage("<yellow>igniteTnt set to: <white>$shouldIgniteTnt")
return@executes Command.SINGLE_SUCCESS
}))
.executes { ctx ->
ctx.source.sender.sendMessage("DisableExplosions config:")
ctx.source.sender.sendMessage(Component.text("igniteTnt: ", NamedTextColor.YELLOW)
.append(Component.text(disableExplosions.igniteTnt.toString(), NamedTextColor.WHITE)))
ctx.source.sender.sendRichMessage("<yellow>igniteTnt: <white>${disableExplosions.igniteTnt}")
return@executes Command.SINGLE_SUCCESS
}
}

View File

@ -6,8 +6,6 @@ import com.mojang.brigadier.arguments.StringArgumentType
import com.mojang.brigadier.builder.LiteralArgumentBuilder
import io.papermc.paper.command.brigadier.CommandSourceStack
import io.papermc.paper.command.brigadier.Commands
import net.kyori.adventure.text.Component
import net.kyori.adventure.text.format.NamedTextColor
import org.bukkit.plugin.java.JavaPlugin
@Suppress("UnstableApiUsage")
@ -21,7 +19,7 @@ object CmdFormatChatConfig {
plugin.config.set("data.formatChat.serverAlias", alias)
formatChat.serverAlias = alias
plugin.saveConfig()
ctx.source.sender.sendMessage(Component.text("serverAlias set to: $alias", NamedTextColor.YELLOW))
ctx.source.sender.sendRichMessage("<yellow>serverAlias set to: <white>$alias")
return@executes Command.SINGLE_SUCCESS
}))
.then(Commands.literal("messageFormat")
@ -31,7 +29,7 @@ object CmdFormatChatConfig {
plugin.config.set("data.formatChat.messageFormat", format)
formatChat.messageFormat = format
plugin.saveConfig()
ctx.source.sender.sendMessage(Component.text("messageFormat set to: $format", NamedTextColor.YELLOW))
ctx.source.sender.sendRichMessage("<yellow>messageFormat set to: <white>$format")
return@executes Command.SINGLE_SUCCESS
}))
.then(Commands.literal("formatMessageText")
@ -41,7 +39,7 @@ object CmdFormatChatConfig {
plugin.config.set("data.formatChat.formatMessageText", shouldFormat)
formatChat.formatMessageText = shouldFormat
plugin.saveConfig()
ctx.source.sender.sendMessage(Component.text("formatMessageText set to: $shouldFormat", NamedTextColor.YELLOW))
ctx.source.sender.sendRichMessage("<yellow>formatMessageText set to: <white>$shouldFormat")
return@executes Command.SINGLE_SUCCESS
}))
.executes { ctx ->
@ -50,15 +48,9 @@ object CmdFormatChatConfig {
val formatMessageText = plugin.config.getBoolean("data.formatChat.formatMessageText", true)
ctx.source.sender.sendMessage("FormatChat config:")
ctx.source.sender.sendMessage(Component.text("serverAlias: ", NamedTextColor.YELLOW)
.append(Component.text(serverAlias, NamedTextColor.WHITE)))
ctx.source.sender.sendMessage(Component.text("messageFormat: ", NamedTextColor.YELLOW)
.append(Component.text(messageFormat, NamedTextColor.WHITE)))
ctx.source.sender.sendMessage(Component.text("formatMessageText: ", NamedTextColor.YELLOW)
.append(Component.text(formatMessageText.toString(), NamedTextColor.WHITE)))
ctx.source.sender.sendRichMessage("<yellow>serverAlias: <white>$serverAlias")
ctx.source.sender.sendRichMessage("<yellow>messageFormat: <white>$messageFormat")
ctx.source.sender.sendRichMessage("<yellow>formatMessageText: <white>$formatMessageText")
return@executes Command.SINGLE_SUCCESS
}

View File

@ -9,8 +9,6 @@ import io.papermc.paper.command.brigadier.Commands
import io.papermc.paper.command.brigadier.argument.ArgumentTypes
import io.papermc.paper.command.brigadier.argument.resolvers.BlockPositionResolver
import io.papermc.paper.plugin.lifecycle.event.types.LifecycleEvents
import net.kyori.adventure.text.Component
import net.kyori.adventure.text.format.NamedTextColor
import org.bukkit.entity.Player
import org.bukkit.plugin.java.JavaPlugin
@ -59,17 +57,17 @@ object CmdPortal {
val location2 = ctx.getArgument("location2", BlockPositionResolver::class.java).resolve(ctx.source)
if (!serverList.contains(destServer)) {
ctx.source.sender.sendMessage(Component.text("No server named $destServer", NamedTextColor.RED))
ctx.source.sender.sendRichMessage("<red>No server named $destServer")
return@executes Command.SINGLE_SUCCESS
}
when (action) {
"add" if portals.exists(name) -> ctx.source.sender.sendMessage(Component.text("A portal called $name already exists!", NamedTextColor.RED))
"update" if !portals.exists(name) -> ctx.source.sender.sendMessage(Component.text("No portal named $name!", NamedTextColor.RED))
"add" if portals.exists(name) -> ctx.source.sender.sendRichMessage("<red>A portal called $name already exists!")
"update" if !portals.exists(name) -> ctx.source.sender.sendRichMessage("<red>No portal named $name!")
else -> {
portals.addOrUpdate(name, location1, location2, destServer)
val actionVerb = if (action == "add") "Added" else "Updated"
ctx.source.sender.sendMessage(Component.text("$actionVerb portal '$name'", NamedTextColor.YELLOW))
ctx.source.sender.sendRichMessage("<yellow>$actionVerb portal '$name'")
}
}
@ -92,7 +90,7 @@ object CmdPortal {
val name = StringArgumentType.getString(ctx, "portal")
if (!portals.exists(name))
ctx.source.sender.sendMessage(Component.text("No portal named $name!", NamedTextColor.RED))
ctx.source.sender.sendRichMessage("<red>No portal named $name!")
else
portals.remove(name)
@ -103,10 +101,10 @@ object CmdPortal {
private fun listPortals(portals: Portals) : LiteralArgumentBuilder<CommandSourceStack> {
return Commands.literal("list")
.executes { ctx ->
ctx.source.sender.sendMessage(Component.text("There are ${portals.portals.count()} portals:", NamedTextColor.YELLOW))
ctx.source.sender.sendRichMessage("<yellow>There are ${portals.portals.count()} portals:")
portals.portals.forEach { portal ->
ctx.source.sender.sendMessage(Component.text(portal.toString(), NamedTextColor.YELLOW))
ctx.source.sender.sendRichMessage("<yellow>$portal")
}
return@executes Command.SINGLE_SUCCESS

View File

@ -85,7 +85,7 @@ class Portals(plugin: JavaPlugin) : ModuleBase(plugin), Listener, PluginMessageL
fun remove(name: String) {
if (!portals.removeIf { portal -> portal.name == name })
plugin.componentLogger.error("Failed to remove portal $name")
plugin.logger.severe("Failed to remove portal $name")
updateConfig()
}

View File

@ -8,8 +8,6 @@ import io.papermc.paper.command.brigadier.CommandSourceStack
import io.papermc.paper.command.brigadier.Commands
import io.papermc.paper.command.brigadier.argument.ArgumentTypes
import io.papermc.paper.registry.RegistryKey
import net.kyori.adventure.text.Component
import net.kyori.adventure.text.format.NamedTextColor
import org.bukkit.NamespacedKey
import org.bukkit.entity.EntityType
import org.bukkit.plugin.java.JavaPlugin
@ -28,24 +26,15 @@ object CmdSnowballDamageConfig {
plugin.config.set("data.snowballDamage.invertDamageList", invert)
plugin.saveConfig()
snowballDamage.invertDamageList = invert
ctx.source.sender.sendMessage(Component.text("invertDamageList set to ", NamedTextColor.YELLOW)
.append(Component.text(invert.toString(), NamedTextColor.WHITE)))
ctx.source.sender.sendRichMessage("<yellow>invertDamageList set to: <white>$invert")
return@executes Command.SINGLE_SUCCESS
}))
.executes { ctx ->
ctx.source.sender.sendMessage("SnowballDamage config:")
ctx.source.sender.sendMessage(Component.text("noClipList: ", NamedTextColor.YELLOW)
.append(Component.text(snowballDamage.noClipList.joinToString(", ") { entityType -> entityType.key.toString() }, NamedTextColor.WHITE)))
ctx.source.sender.sendMessage(Component.text("damageList: ", NamedTextColor.YELLOW)
.append(Component.text(snowballDamage.damageList.joinToString(", ") { entityType -> entityType.key.toString() }, NamedTextColor.WHITE)))
ctx.source.sender.sendMessage(Component.text("invertDamageList: ", NamedTextColor.YELLOW)
.append(Component.text(snowballDamage.invertDamageList.toString(), NamedTextColor.WHITE)))
ctx.source.sender.sendRichMessage("<yellow>noClipList: <white>${snowballDamage.noClipList.joinToString(", ") { entityType -> entityType.key.toString() }}")
ctx.source.sender.sendRichMessage("<yellow>damageList: <white>${snowballDamage.damageList.joinToString(", ") { entityType -> entityType.key.toString() }}")
ctx.source.sender.sendRichMessage("<yellow>invertDamageList: <white>${snowballDamage.invertDamageList}")
return@executes Command.SINGLE_SUCCESS
}
}
@ -64,14 +53,14 @@ object CmdSnowballDamageConfig {
}
if (list.contains(entityType)) {
ctx.source.sender.sendMessage(Component.text("$listName already contains ${entityType.key}", NamedTextColor.RED))
ctx.source.sender.sendRichMessage("<red>$listName already contains ${entityType.key}")
return@executes Command.SINGLE_SUCCESS
}
list.add(entityType)
plugin.config.set("data.snowballDamage.$listName", list.map { type -> type.key.toString() })
plugin.saveConfig()
ctx.source.sender.sendMessage(Component.text("${entityType.key} added to $listName", NamedTextColor.YELLOW))
ctx.source.sender.sendRichMessage("$<yellow>{entityType.key} added to $listName")
return@executes Command.SINGLE_SUCCESS
}))
@ -94,7 +83,7 @@ object CmdSnowballDamageConfig {
val entityType = EntityType.fromName(key?.key)
if (entityType == null) {
ctx.source.sender.sendMessage(Component.text("Unknown entity type: $entityTypeName", NamedTextColor.RED))
ctx.source.sender.sendRichMessage("<red>Unknown entity type: $entityTypeName")
return@executes Command.SINGLE_SUCCESS
}
@ -105,14 +94,14 @@ object CmdSnowballDamageConfig {
}
if (!list.contains(entityType)) {
ctx.source.sender.sendMessage(Component.text("$listName does not contain ${entityType.key}", NamedTextColor.RED))
ctx.source.sender.sendRichMessage("<red>$listName does not contain ${entityType.key}")
return@executes Command.SINGLE_SUCCESS
}
list.remove(entityType)
plugin.config.set("data.snowballDamage.$listName", list.map { type -> type.key.toString() })
plugin.saveConfig()
ctx.source.sender.sendMessage(Component.text("${entityType.key} removed from $listName", NamedTextColor.YELLOW))
ctx.source.sender.sendRichMessage("<yellow>${entityType.key} removed from $listName")
return@executes Command.SINGLE_SUCCESS
}))
@ -126,7 +115,7 @@ object CmdSnowballDamageConfig {
"damageList" -> snowballDamage.damageList.clear()
}
ctx.source.sender.sendMessage(Component.text("Cleared $listName", NamedTextColor.YELLOW))
ctx.source.sender.sendRichMessage("<yellow>Cleared $listName")
return@executes Command.SINGLE_SUCCESS
})
}

View File

@ -4,8 +4,6 @@ import com.mojang.brigadier.Command
import com.pobnellion.pobutils.Pobutils
import io.papermc.paper.command.brigadier.Commands
import io.papermc.paper.plugin.lifecycle.event.types.LifecycleEvents
import net.kyori.adventure.text.Component
import net.kyori.adventure.text.format.NamedTextColor
import org.bukkit.entity.Player
import org.bukkit.plugin.java.JavaPlugin
@ -16,7 +14,7 @@ object CmdSpawn {
.requires { source -> Pobutils.isEnabled(spawn.name) && source.sender is Player }
.executes { ctx ->
if (spawn.spawnLocation == null)
ctx.source.sender.sendMessage(Component.text("A spawn location has not been set", NamedTextColor.RED))
ctx.source.sender.sendRichMessage("<red>A spawn location has not been set")
else
(ctx.source.sender as Player).teleport(spawn.spawnLocation!!)

View File

@ -7,10 +7,7 @@ import com.mojang.brigadier.builder.LiteralArgumentBuilder
import io.papermc.paper.command.brigadier.CommandSourceStack
import io.papermc.paper.command.brigadier.Commands
import io.papermc.paper.command.brigadier.argument.ArgumentTypes
import io.papermc.paper.command.brigadier.argument.resolvers.BlockPositionResolver
import io.papermc.paper.command.brigadier.argument.resolvers.FinePositionResolver
import net.kyori.adventure.text.Component
import net.kyori.adventure.text.format.NamedTextColor
import org.bukkit.entity.Player
import org.bukkit.plugin.java.JavaPlugin
@ -24,16 +21,9 @@ object CmdSpawnConfig {
.executes { ctx ->
val location = plugin.config.getLocation("data.spawn.location")
ctx.source.sender.sendMessage("Spawn config:")
ctx.source.sender.sendMessage(Component.text("location: ", NamedTextColor.YELLOW)
.append(Component.text("${location?.x} ${location?.y} ${location?.z}", NamedTextColor.WHITE)))
ctx.source.sender.sendMessage(Component.text("spawnOnJoin: ", NamedTextColor.YELLOW)
.append(Component.text(plugin.config.getString("data.spawn.spawnOnJoin").orEmpty(), NamedTextColor.WHITE)))
ctx.source.sender.sendMessage(Component.text("spawnOnDeath: ", NamedTextColor.YELLOW)
.append(Component.text(plugin.config.getString("data.spawn.spawnOnDeath").orEmpty(), NamedTextColor.WHITE)))
ctx.source.sender.sendRichMessage("<yellow>location: <white>${location?.x} ${location?.y} ${location?.z}")
ctx.source.sender.sendRichMessage("<yellow>spawnOnJoin: <white>${plugin.config.getString("data.spawn.spawnOnJoin").orEmpty()}")
ctx.source.sender.sendRichMessage("<yellow>spawnOnDeath: <white>${plugin.config.getString("data.spawn.spawnOnDeath").orEmpty()}")
return@executes Command.SINGLE_SUCCESS
}
}
@ -62,7 +52,7 @@ object CmdSpawnConfig {
"south" -> location.yaw = 0f
"west" -> location.yaw = 90f
else -> {
ctx.source.sender.sendMessage(Component.text("Unknown direction: $direction", NamedTextColor.RED))
ctx.source.sender.sendRichMessage("<red>Unknown direction: $direction")
return@executes Command.SINGLE_SUCCESS
}
}
@ -70,7 +60,7 @@ object CmdSpawnConfig {
spawn.spawnLocation = location
plugin.config.set("data.spawn.location", location)
plugin.saveConfig()
ctx.source.sender.sendMessage(Component.text("Set spawn location to ${location.x} ${location.y} ${location.z}", NamedTextColor.YELLOW))
ctx.source.sender.sendRichMessage("<yellow>Set spawn location to ${location.x} ${location.y} ${location.z}")
return@executes Command.SINGLE_SUCCESS
}))
}
@ -88,7 +78,7 @@ object CmdSpawnConfig {
plugin.saveConfig()
plugin.reloadConfig()
ctx.source.sender.sendMessage(Component.text("$variableName set to: $value", NamedTextColor.YELLOW))
ctx.source.sender.sendRichMessage("<yellow>$variableName set to: $value")
return@executes Command.SINGLE_SUCCESS
})
}

View File

@ -5,8 +5,6 @@ import com.mojang.brigadier.arguments.StringArgumentType
import com.pobnellion.pobutils.Pobutils
import io.papermc.paper.command.brigadier.Commands
import io.papermc.paper.plugin.lifecycle.event.types.LifecycleEvents
import net.kyori.adventure.text.Component
import net.kyori.adventure.text.format.NamedTextColor
import org.bukkit.entity.Player
import org.bukkit.plugin.java.JavaPlugin
@ -28,7 +26,7 @@ object CmdWarp {
val warpLocation = warp.warps[warpName]
if (warpLocation == null)
ctx.source.sender.sendMessage(Component.text("No warp named '$warpName'", NamedTextColor.RED))
ctx.source.sender.sendRichMessage("<red>No warp named '$warpName'")
else
(ctx.source.sender as Player).teleport(warpLocation)

View File

@ -6,10 +6,7 @@ import com.mojang.brigadier.builder.LiteralArgumentBuilder
import io.papermc.paper.command.brigadier.CommandSourceStack
import io.papermc.paper.command.brigadier.Commands
import io.papermc.paper.command.brigadier.argument.ArgumentTypes
import io.papermc.paper.command.brigadier.argument.resolvers.BlockPositionResolver
import io.papermc.paper.command.brigadier.argument.resolvers.FinePositionResolver
import net.kyori.adventure.text.Component
import net.kyori.adventure.text.format.NamedTextColor
import org.bukkit.entity.Player
import org.bukkit.plugin.java.JavaPlugin
@ -31,9 +28,7 @@ object CmdWarpConfig {
for (warpName in warpNames) {
val location = plugin.config.getLocation("data.warps.$warpName")!!
ctx.source.sender.sendMessage(Component.text("$warpName:", NamedTextColor.YELLOW)
.append(Component.text("${location.x} ${location.y} ${location.z}")))
ctx.source.sender.sendRichMessage("<yellow>$warpName: <white>${location.x} ${location.y} ${location.z}")
}
return@executes Command.SINGLE_SUCCESS
@ -50,16 +45,14 @@ object CmdWarpConfig {
val location = position.toLocation((ctx.source.sender as Player).world)
if (plugin.config.get("data.warps.$name") != null) {
ctx.source.sender.sendMessage(Component.text("A warp called $name already exists!", NamedTextColor.RED))
ctx.source.sender.sendRichMessage("<red>A warp called $name already exists!")
return@executes Command.SINGLE_SUCCESS
}
plugin.config.set("data.warps.$name", location)
plugin.saveConfig()
warp.warps[name] = location
ctx.source.sender.sendMessage(Component.text("Created warp '$name'", NamedTextColor.YELLOW))
ctx.source.sender.sendRichMessage("<yellow>Created warp '$name'")
return@executes Command.SINGLE_SUCCESS
}))
@ -80,7 +73,7 @@ object CmdWarpConfig {
val location = position.toLocation((ctx.source.sender as Player).world)
if (plugin.config.get("data.warps.$name") == null) {
ctx.source.sender.sendMessage(Component.text("Could not find a warp called $name!", NamedTextColor.RED))
ctx.source.sender.sendRichMessage("<red>Could not find a warp called $name!")
return@executes Command.SINGLE_SUCCESS
}
@ -89,7 +82,7 @@ object CmdWarpConfig {
warp.warps[name] = location
ctx.source.sender.sendMessage(Component.text("Updated warp '$name'", NamedTextColor.YELLOW))
ctx.source.sender.sendRichMessage("<yellow>Updated warp '$name'")
return@executes Command.SINGLE_SUCCESS
}))
@ -107,7 +100,7 @@ object CmdWarpConfig {
val name = StringArgumentType.getString(ctx, "name")
if (plugin.config.get("data.warps.$name") == null) {
ctx.source.sender.sendMessage(Component.text("Could not find a warp called $name!", NamedTextColor.RED))
ctx.source.sender.sendRichMessage("<red>Could not find a warp called $name!")
return@executes Command.SINGLE_SUCCESS
}
@ -115,8 +108,7 @@ object CmdWarpConfig {
plugin.saveConfig()
warp.warps.remove(name)
ctx.source.sender.sendMessage(Component.text("Removed warp '$name'", NamedTextColor.YELLOW))
ctx.source.sender.sendRichMessage("<yellow>Removed warp '$name'")
return@executes Command.SINGLE_SUCCESS
})