From 6923c06d0a7e0c52989890c868256db20479f141 Mon Sep 17 00:00:00 2001 From: Llm Dl Date: Mon, 14 Dec 2020 17:44:34 -0600 Subject: [PATCH] - Allow hex colour codes to be used in the messagecolour options channels.yml. - Closes https://github.com/TownyAdvanced/Towny/issues/4087. --- resources/changelog.txt | 4 +++- .../bukkit/TownyChat/channels/StandardChannel.java | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/resources/changelog.txt b/resources/changelog.txt index aaa7397..f32bd90 100644 --- a/resources/changelog.txt +++ b/resources/changelog.txt @@ -351,4 +351,6 @@ v0.83: - Fix spam countdown resetting if you speak too early. v0.84: - Fix nation and town names not parsing out the _'s for spaces. - - Closes https://github.com/TownyAdvanced/Towny/issues/4489. \ No newline at end of file + - Closes https://github.com/TownyAdvanced/Towny/issues/4489. + - Allow hex colour codes to be used in the messagecolour options channels.yml. + - Closes https://github.com/TownyAdvanced/Towny/issues/4087. \ No newline at end of file diff --git a/src/com/palmergames/bukkit/TownyChat/channels/StandardChannel.java b/src/com/palmergames/bukkit/TownyChat/channels/StandardChannel.java index b1cb59b..28c6e53 100644 --- a/src/com/palmergames/bukkit/TownyChat/channels/StandardChannel.java +++ b/src/com/palmergames/bukkit/TownyChat/channels/StandardChannel.java @@ -128,7 +128,7 @@ public class StandardChannel extends Channel { * Only modify GLOBAL channelType chat (general and local chat channels) if isModifyChat() is true. */ if (!(exec.equals(channelTypes.GLOBAL) && !ChatSettings.isModify_chat())) { - event.setFormat(Format.replace("{channelTag}", getChannelTag()).replace("{msgcolour}", getMessageColour())); + event.setFormat(Format.replace("{channelTag}", getChannelTag()).replace("{msgcolour}", TownyChatFormatter.hexIfCompatible(getMessageColour()))); LocalTownyChatEvent chatEvent = new LocalTownyChatEvent(event, resident); event.setFormat(TownyChatFormatter.getChatFormat(chatEvent)); }