Fix signed book page serialization (#10696)

This commit is contained in:
Jason Penilla 2024-05-11 15:13:18 -07:00
parent 702864d8f8
commit f9008ceb01

View file

@ -179,6 +179,21 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
}
}
@@ -0,0 +0,0 @@ public class CraftMetaBookSigned extends CraftMetaItem implements BookMeta {
}
if (this.pages != null) {
- builder.put(CraftMetaBookSigned.BOOK_PAGES.BUKKIT, ImmutableList.copyOf(this.pages));
+ // Paper start - deserialization expects json
+ final List<String> jsonPages = new ArrayList<>(this.pages.size());
+ for (final Component page : this.pages) {
+ jsonPages.add(CraftChatMessage.toJSON(page));
+ }
+ builder.put(CraftMetaBookSigned.BOOK_PAGES.BUKKIT, ImmutableList.copyOf(jsonPages));
+ // Paper end - deserialization expects json
}
if (this.resolved) {
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaFirework.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaFirework.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaFirework.java