Only rewrite pages in written book

This commit is contained in:
Nassim Jahnke 2024-01-31 17:14:05 +01:00
parent 0d788b0d7a
commit 87d444a017
No known key found for this signature in database
GPG Key ID: EF6771C01F6EF02F
2 changed files with 2 additions and 2 deletions

View File

@ -142,7 +142,7 @@ public final class BlockItemPacketRewriter1_20_3 extends ItemRewriter<Clientboun
}
final CompoundTag tag = item.tag();
if (tag != null) {
if (tag != null && item.identifier() == 1047) { // Written book
updatePages(tag, "pages");
updatePages(tag, "filtered_pages");
}

View File

@ -81,7 +81,7 @@ public final class ComponentUtil {
}
public static @Nullable JsonElement convertJson(@Nullable final String json, final SerializerVersion from, final SerializerVersion to) {
return json != null ? convert(from, to, from.jsonSerializer.deserialize(json)) : null;
return json != null ? convert(from, to, from.jsonSerializer.deserializeReader(json)) : null;
}
private static JsonElement convert(final SerializerVersion from, final SerializerVersion to, final ATextComponent component) {