Use asUnformattedString instead of asLegacyFormatString

This commit is contained in:
RaphiMC 2024-09-24 20:58:01 +02:00
parent a6f47d6633
commit f9f02c4729
No known key found for this signature in database
GPG Key ID: 0F6BB0657A03AC94
2 changed files with 2 additions and 2 deletions

View File

@ -1364,7 +1364,7 @@ public class Protocolr1_7_6_10Tor1_8 extends AbstractProtocol<ClientboundPackets
handler(wrapper -> {
for (int i = 0; i < 4; i++) {
final JsonElement component = wrapper.read(Types.COMPONENT); // line
String text = TextComponentSerializer.V1_8.deserialize(component).asLegacyFormatString();
String text = TextComponentSerializer.V1_8.deserialize(component).asUnformattedString();
if (text.length() > 15) text = text.substring(0, 15);
wrapper.write(Types.STRING, text);
}

View File

@ -133,7 +133,7 @@ public class ItemRewriter extends LegacyItemRewriter<ClientboundPackets1_7_2, Se
for (int i = 0; i < pages.size(); i++) {
final String text = pages.get(i).getValue();
pages.set(i, new StringTag(TextComponentSerializer.V1_8.deserialize(text).asLegacyFormatString()));
pages.set(i, new StringTag(TextComponentSerializer.V1_8.deserialize(text).asUnformattedString()));
}
}