From 32d286ee3630a2b80f40f7634d69c046ca5141fa Mon Sep 17 00:00:00 2001 From: Jacob Gillespie Date: Sun, 21 Feb 2016 09:58:20 -0600 Subject: [PATCH] Do not translate colors from Discord --- src/main/kotlin/gg/obsidian/discordbridge/Util.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/kotlin/gg/obsidian/discordbridge/Util.kt b/src/main/kotlin/gg/obsidian/discordbridge/Util.kt index 62871c7..788828d 100644 --- a/src/main/kotlin/gg/obsidian/discordbridge/Util.kt +++ b/src/main/kotlin/gg/obsidian/discordbridge/Util.kt @@ -5,12 +5,13 @@ import org.bukkit.ChatColor object Util { fun formatMessage(message: String, replacements: Map, colors: Boolean = false): String { var formattedString = message + + if (colors) formattedString = ChatColor.translateAlternateColorCodes('&', formattedString) + for ((token, replacement) in replacements) { formattedString = formattedString.replace(token, replacement) } - if (colors) formattedString = ChatColor.translateAlternateColorCodes('&', formattedString) - return formattedString } }