diff --git a/src/main/java/net/draycia/carbon/channels/impls/CarbonChatChannel.java b/src/main/java/net/draycia/carbon/channels/impls/CarbonChatChannel.java index 1d434251..207cfc44 100644 --- a/src/main/java/net/draycia/carbon/channels/impls/CarbonChatChannel.java +++ b/src/main/java/net/draycia/carbon/channels/impls/CarbonChatChannel.java @@ -137,12 +137,7 @@ public class CarbonChatChannel extends ChatChannel { targetColor.asHexString()).append(formatComponent); } - TextComponent messageComponent = (TextComponent) carbonChat.getAdventureManager().processMessage(formatEvent.getMessage(), - "br", "\n", - "displayname", displayName, - "color", "<" + targetColor.asHexString() + ">", - "phase", Long.toString(System.currentTimeMillis() % 25), - "server", carbonChat.getConfig().getString("server-name", "Server")); + TextComponent messageComponent = TextComponent.of(formatEvent.getMessage()); TextComponent processedComponent = (TextComponent)formatComponent.replaceFirstText(MESSAGE_PATTERN, (input) -> { return messageComponent.toBuilder(); @@ -164,20 +159,14 @@ public class CarbonChatChannel extends ChatChannel { TextColor targetColor = getChannelColor(user); TextComponent consoleFormat = (TextComponent) carbonChat.getAdventureManager().processMessage(consoleFormatEvent.getFormat(), - "br", "\n", - "displayname", displayName, - "color", "<" + targetColor.asHexString() + ">", - "phase", Long.toString(System.currentTimeMillis() % 25), - "server", carbonChat.getConfig().getString("server-name", "Server"), - "message", consoleFormatEvent.getMessage()); - - TextComponent consoleMessage = (TextComponent) carbonChat.getAdventureManager().processMessage(consoleFormatEvent.getMessage(), "br", "\n", "displayname", displayName, "color", "<" + targetColor.asHexString() + ">", "phase", Long.toString(System.currentTimeMillis() % 25), "server", carbonChat.getConfig().getString("server-name", "Server")); + TextComponent consoleMessage = TextComponent.of(consoleFormatEvent.getMessage()); + TextComponent consoleComponent = (TextComponent)consoleFormat.replaceFirstText(MESSAGE_PATTERN, (input) -> { return consoleMessage.toBuilder(); }); diff --git a/src/main/resources/language.yml b/src/main/resources/language.yml index 978f7758..57d7d447 100644 --- a/src/main/resources/language.yml +++ b/src/main/resources/language.yml @@ -4,7 +4,7 @@ # 'MineDown': https://github.com/Phoenix616/MineDown#syntax # 'JSON': https://minecraft.gamepedia.com/Raw_JSON_text_format # Note that the messages provided in the default config utilise MiniMessage, and need to be changed if you're using MineDown -# Please DO NOT use JSON formatting unless you really know what you're doing +# Please DO NOT use JSON formatting unless you really know what you're doing. formatting: type: 'MiniMessage'