mirror of
https://github.com/darksaid98/Carbon.git
synced 2026-12-01 22:15:08 +00:00
Attempt to fix legacy color codes with rainbow
This commit is contained in:
1 parent
8bba8c7618
commit
90e5365a69
1 file changed
+7
@@ -2,6 +2,7 @@ package net.draycia.simplechat.channels.impls;
|
||||
|
||||
import me.clip.placeholderapi.PlaceholderAPI;
|
||||
import me.minidigger.minimessage.text.MiniMessageParser;
|
||||
import me.minidigger.minimessage.text.MiniMessageSerializer;
|
||||
import net.draycia.simplechat.SimpleChat;
|
||||
import net.draycia.simplechat.channels.ChatChannel;
|
||||
import net.draycia.simplechat.events.ChannelChatEvent;
|
||||
@@ -138,6 +139,12 @@ public class SimpleChatChannel extends ChatChannel {
|
||||
}
|
||||
|
||||
messageFormat = PlaceholderAPI.setPlaceholders(player, event.getFormat());
|
||||
|
||||
// Convert legacy color codes to Mini color codes
|
||||
Component component = LegacyComponentSerializer.legacy('&').deserialize(messageFormat);
|
||||
messageFormat = MiniMessageSerializer.serialize(component);
|
||||
|
||||
// Continue parsing the format
|
||||
messageFormat = MiniMessageParser.handlePlaceholders(messageFormat, "color", "<" + color.toString() + ">", "phase", Long.toString(System.currentTimeMillis() % 25));
|
||||
messageFormat = MiniMessageParser.handlePlaceholders(messageFormat, "message", event.getMessage());
|
||||
|
||||
|
||||
Reference in new issue
Block a user