aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJason Penilla <[email protected]>2024-05-11 10:48:26 -0700
committerBjarne Koll <[email protected]>2024-05-11 23:50:43 +0200
commit85319a44e767aff4275e689421dbea41cb8ea4fe (patch)
tree037c31f18d3247d53fcd49f36c139cb42eeb4ded
parentac554ad46dabb20bbfee5f3b576baa53485b2ac7 (diff)
downloadPaper-85319a44e767aff4275e689421dbea41cb8ea4fe.tar.gz
Paper-85319a44e767aff4275e689421dbea41cb8ea4fe.zip
Fix signed book page serialization
-rw-r--r--patches/server/0008-CB-fixes.patch19
-rw-r--r--patches/server/0010-Adventure.patch2
2 files changed, 20 insertions, 1 deletions
diff --git a/patches/server/0008-CB-fixes.patch b/patches/server/0008-CB-fixes.patch
index 2c625b3d58..ca455ce7c4 100644
--- a/patches/server/0008-CB-fixes.patch
+++ b/patches/server/0008-CB-fixes.patch
@@ -98,6 +98,25 @@ index 1e3ca7ca98abfd5be233a7eeb6dad201776d2d6a..9ec50bbb262b25fea157ae48e8395f5c
this.acceptsAll(Main.asList("nogui"), "Disables the graphical console");
this.acceptsAll(Main.asList("nojline"), "Disables jline and emulates the vanilla console");
+diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBookSigned.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBookSigned.java
+index 9c57b883783145ad4483481a2c2e7f0f188cd174..4ffcdff978bb68e74bf19f43433204e9ca3cd2d6 100644
+--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBookSigned.java
++++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBookSigned.java
+@@ -358,7 +358,13 @@ 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
++ List<String> jsonPages = new ArrayList<>();
++ 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/CraftMetaMap.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaMap.java
index 6b34a8d33faa49ffa9082995e67af10d3cb38c03..f0c817e27a602740bc979b2ebaec3917e1906d74 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaMap.java
diff --git a/patches/server/0010-Adventure.patch b/patches/server/0010-Adventure.patch
index f83b3b6f40..4ab78bf77c 100644
--- a/patches/server/0010-Adventure.patch
+++ b/patches/server/0010-Adventure.patch
@@ -5013,7 +5013,7 @@ index 2e6f0a0f4bbe4ae3c7c85e679f6187e89d1298ff..c7360e2b2d6e50abc371c21b09cdadd6
super.serialize(builder);
if (this.hasTitle()) {
-@@ -459,4 +459,113 @@ public class CraftMetaBookSigned extends CraftMetaItem implements BookMeta {
+@@ -465,4 +465,113 @@ public class CraftMetaBookSigned extends CraftMetaItem implements BookMeta {
return this.spigot;
}
// Spigot end