Skip to content

Commit

Permalink
Use asUnformattedString instead of asLegacyFormatString
Browse files Browse the repository at this point in the history
  • Loading branch information
RaphiMC committed Sep 24, 2024
1 parent a6f47d6 commit f9f02c4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1364,7 +1364,7 @@ public void register() {
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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ public Item handleItemToServer(final UserConnection user, final Item item) {

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()));
}
}

Expand Down

0 comments on commit f9f02c4

Please sign in to comment.