mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2024-11-01 05:57:09 +00:00
Convert tags automatically when loading them in to avoid errors
This commit is contained in:
parent
f474ce99fd
commit
773805101b
@ -53,7 +53,14 @@ public class PlayerData
|
|||||||
ips.addAll(FUtil.stringToList(resultSet.getString("ips")));
|
ips.addAll(FUtil.stringToList(resultSet.getString("ips")));
|
||||||
notes.clear();
|
notes.clear();
|
||||||
notes.addAll(FUtil.stringToList(resultSet.getString("notes")));
|
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");
|
discordID = resultSet.getString("discord_id");
|
||||||
masterBuilder = resultSet.getBoolean("master_builder");
|
masterBuilder = resultSet.getBoolean("master_builder");
|
||||||
rideMode = RideMode.valueOf(resultSet.getString("ride_mode").toUpperCase());
|
rideMode = RideMode.valueOf(resultSet.getString("ride_mode").toUpperCase());
|
||||||
|
@ -83,6 +83,7 @@ public class FUtil
|
|||||||
|
|
||||||
private static final PlainTextComponentSerializer STEAMROLLER = PlainTextComponentSerializer.plainText();
|
private static final PlainTextComponentSerializer STEAMROLLER = PlainTextComponentSerializer.plainText();
|
||||||
public static final LegacyComponentSerializer LEGACY_AMPERSAND = LegacyComponentSerializer.legacyAmpersand();
|
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(
|
public static final MiniMessage MINI_MESSAGE = MiniMessage.builder().tags(TagResolver.resolver(
|
||||||
StandardTags.color(),
|
StandardTags.color(),
|
||||||
StandardTags.rainbow(),
|
StandardTags.rainbow(),
|
||||||
@ -490,6 +491,11 @@ public class FUtil
|
|||||||
return LEGACY_AMPERSAND.deserialize(string);
|
return LEGACY_AMPERSAND.deserialize(string);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static Component colorizeAsComponentSection(String string)
|
||||||
|
{
|
||||||
|
return LEGACY_SECTION.deserialize(string);
|
||||||
|
}
|
||||||
|
|
||||||
public static Component miniMessage(String string, TagResolver... placeholders)
|
public static Component miniMessage(String string, TagResolver... placeholders)
|
||||||
{
|
{
|
||||||
return MINI_MESSAGE.deserialize(string, placeholders);
|
return MINI_MESSAGE.deserialize(string, placeholders);
|
||||||
|
Loading…
Reference in New Issue
Block a user