From 6744f337512da95fa2cec0dff1787ee42fb95868 Mon Sep 17 00:00:00 2001 From: 98ping <67809373+98ping@users.noreply.github.com> Date: Sun, 12 Mar 2023 12:40:51 -0700 Subject: [PATCH] format punishment messages --- .../alchemist/listeners/profile/ProfileJoinListener.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spigot/src/main/kotlin/ltd/matrixstudios/alchemist/listeners/profile/ProfileJoinListener.kt b/spigot/src/main/kotlin/ltd/matrixstudios/alchemist/listeners/profile/ProfileJoinListener.kt index b1f43ce16..79f1492c3 100644 --- a/spigot/src/main/kotlin/ltd/matrixstudios/alchemist/listeners/profile/ProfileJoinListener.kt +++ b/spigot/src/main/kotlin/ltd/matrixstudios/alchemist/listeners/profile/ProfileJoinListener.kt @@ -114,7 +114,7 @@ class ProfileJoinListener : Listener { msgs.replaceAll { it.replace("", if (punishment!!.expirable.duration == Long.MAX_VALUE) "Never" else TimeUtil.formatDuration(punishment.expirable.addedAt + punishment.expirable.duration - System.currentTimeMillis())) } event.loginResult = AsyncPlayerPreLoginEvent.Result.KICK_BANNED - event.kickMessage = msgs.joinToString("\n") + event.kickMessage = msgs.map { Chat.format(it) }.joinToString("\n") } else if (profile.hasActivePunishment(PunishmentType.BLACKLIST)) { val punishments = profile.getActivePunishments(PunishmentType.BLACKLIST).toMutableList() punishments.addAll(profile.getActivePunishments(PunishmentType.BAN)) @@ -125,7 +125,7 @@ class ProfileJoinListener : Listener { msgs.replaceAll { it.replace("", punishment!!.reason) } msgs.replaceAll { it.replace("", if (punishment!!.expirable.duration == Long.MAX_VALUE) "Never" else TimeUtil.formatDuration(punishment.expirable.addedAt + punishment.expirable.duration - System.currentTimeMillis())) } - event.kickMessage = msgs.joinToString("\n") + event.kickMessage = msgs.map { Chat.format(it) }.joinToString("\n") } val currentServer = AlchemistSpigotPlugin.instance.globalServer