mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-28 10:53:51 -07:00
Ignore errors when parsing books and treat them as old books
In previous versions there was a mistake with book handled which may leave books in a broken state, this tries to handle that
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user