summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBook.java6
-rw-r--r--src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBookSigned.java6
2 files changed, 10 insertions, 2 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBook.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBook.java
index debca310..0c69a3e7 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBook.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBook.java
@@ -78,7 +78,11 @@ class CraftMetaBook extends CraftMetaItem implements BookMeta {
for (int i = 0; i < pages.size(); i++) {
String page = pages.getString(i);
if (resolved) {
- page = CraftChatMessage.fromComponent(ChatSerializer.a(page));
+ try {
+ page = CraftChatMessage.fromComponent(ChatSerializer.a(page));
+ } catch (Exception e) {
+ // Ignore and treat as an old book
+ }
}
pageArray[i] = page;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBookSigned.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBookSigned.java
index fd8ba56d..8c3d3a44 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBookSigned.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBookSigned.java
@@ -39,7 +39,11 @@ class CraftMetaBookSigned extends CraftMetaBook implements BookMeta {
for (int i = 0; i < pages.size(); i++) {
String page = pages.getString(i);
if (resolved) {
- page = CraftChatMessage.fromComponent(ChatSerializer.a(page));
+ try {
+ page = CraftChatMessage.fromComponent(ChatSerializer.a(page));
+ } catch (Exception e) {
+ // Ignore and treat as an old book
+ }
}
pageArray[i] = page;
}