Skip to content

Commit

Permalink
format punishment messages
Browse files Browse the repository at this point in the history
  • Loading branch information
98ping committed Mar 12, 2023
1 parent 1952e30 commit 6744f33
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ class ProfileJoinListener : Listener {
msgs.replaceAll { it.replace("<expires>", 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))
Expand All @@ -125,7 +125,7 @@ class ProfileJoinListener : Listener {
msgs.replaceAll { it.replace("<reason>", punishment!!.reason) }
msgs.replaceAll { it.replace("<expires>", 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
Expand Down

0 comments on commit 6744f33

Please sign in to comment.