From 2f4b4c0651c75a2a8a59dcbd91d7eb97d41a48ad Mon Sep 17 00:00:00 2001 From: DaMachinator Date: Tue, 23 Jan 2018 13:30:07 -0500 Subject: [PATCH] Messages with events we can't handle are now thrown out --- .../kotlin/civilengineering/bridge/ServerChatHelper.kt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/kotlin/civilengineering/bridge/ServerChatHelper.kt b/src/main/kotlin/civilengineering/bridge/ServerChatHelper.kt index afdd190..f18c927 100644 --- a/src/main/kotlin/civilengineering/bridge/ServerChatHelper.kt +++ b/src/main/kotlin/civilengineering/bridge/ServerChatHelper.kt @@ -21,11 +21,15 @@ class ServerChatHelper { val message: String if (!text.isEmpty()) { + val section: Char = '\u00A7' message = when (nextMessage.event) { "user_action" -> "* $user $text" - else -> "<$user> $text" + "" -> "<$user> $text" + "join_leave" -> section.toString()+"6-- $user $text" + else -> "" } - FMLCommonHandler.instance().minecraftServerInstance.playerList.sendMessage(TextComponentString(message)) + if (message.isNotEmpty()) + FMLCommonHandler.instance().minecraftServerInstance.playerList.sendMessage(TextComponentString(message)) } } }