Change legacySerilizer to serialize using bungee hex colors

This commit is contained in:
Marc Baloup 2021-07-20 01:25:17 +02:00
parent 326ee13bef
commit bdb944f961
Signed by: marcbal
GPG Key ID: BBC0FE3ABC30B893

View File

@ -55,8 +55,12 @@ public abstract class Chat extends ChatStatic implements HoverEventSource<Compon
return toBungeeArray(getAdv()); return toBungeeArray(getAdv());
} }
private static final LegacyComponentSerializer LEGACY_SERIALIZER_BUNGEE_FIENDLY = LegacyComponentSerializer.builder()
.hexColors()
.useUnusualXRepeatedCharacterHexFormat()
.build();
public String getLegacyText() { public String getLegacyText() {
return LegacyComponentSerializer.legacySection().serialize(getAdv()); return LEGACY_SERIALIZER_BUNGEE_FIENDLY.serialize(getAdv());
} }
@SuppressWarnings("deprecation") @SuppressWarnings("deprecation")