diff --git a/commons/src/main/java/me/totalfreedom/totalfreedommod/player/PlayerData.java b/commons/src/main/java/me/totalfreedom/totalfreedommod/player/PlayerData.java index 2872a2f8..08e648ce 100644 --- a/commons/src/main/java/me/totalfreedom/totalfreedommod/player/PlayerData.java +++ b/commons/src/main/java/me/totalfreedom/totalfreedommod/player/PlayerData.java @@ -53,7 +53,14 @@ public class PlayerData ips.addAll(FUtil.stringToList(resultSet.getString("ips"))); notes.clear(); notes.addAll(FUtil.stringToList(resultSet.getString("notes"))); - tag = FUtil.miniMessage(resultSet.getString("tag")); + String tempTag = resultSet.getString("tag"); + //-- + if (!Strings.isNullOrEmpty(tempTag) && FUtil.containsChatColor(tempTag)) + { + tempTag = FUtil.miniMessage(FUtil.colorizeAsComponentSection(tempTag)); + } + //-- + tag = FUtil.miniMessage(tempTag); discordID = resultSet.getString("discord_id"); masterBuilder = resultSet.getBoolean("master_builder"); rideMode = RideMode.valueOf(resultSet.getString("ride_mode").toUpperCase()); diff --git a/commons/src/main/java/me/totalfreedom/totalfreedommod/util/FUtil.java b/commons/src/main/java/me/totalfreedom/totalfreedommod/util/FUtil.java index 12c40e64..7aa8f2b8 100644 --- a/commons/src/main/java/me/totalfreedom/totalfreedommod/util/FUtil.java +++ b/commons/src/main/java/me/totalfreedom/totalfreedommod/util/FUtil.java @@ -83,6 +83,7 @@ public class FUtil private static final PlainTextComponentSerializer STEAMROLLER = PlainTextComponentSerializer.plainText(); public static final LegacyComponentSerializer LEGACY_AMPERSAND = LegacyComponentSerializer.legacyAmpersand(); + public static final LegacyComponentSerializer LEGACY_SECTION = LegacyComponentSerializer.legacySection(); public static final MiniMessage MINI_MESSAGE = MiniMessage.builder().tags(TagResolver.resolver( StandardTags.color(), StandardTags.rainbow(), @@ -490,6 +491,11 @@ public class FUtil return LEGACY_AMPERSAND.deserialize(string); } + public static Component colorizeAsComponentSection(String string) + { + return LEGACY_SECTION.deserialize(string); + } + public static Component miniMessage(String string, TagResolver... placeholders) { return MINI_MESSAGE.deserialize(string, placeholders);