Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-11-16 13:00:06 +01: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
Dieser Commit ist enthalten in:
Ursprung
7017af7e6d
Commit
81db41b4d2
@ -78,7 +78,11 @@ class CraftMetaBook extends CraftMetaItem implements BookMeta {
|
|||||||
for (int i = 0; i < pages.size(); i++) {
|
for (int i = 0; i < pages.size(); i++) {
|
||||||
String page = pages.getString(i);
|
String page = pages.getString(i);
|
||||||
if (resolved) {
|
if (resolved) {
|
||||||
|
try {
|
||||||
page = CraftChatMessage.fromComponent(ChatSerializer.a(page));
|
page = CraftChatMessage.fromComponent(ChatSerializer.a(page));
|
||||||
|
} catch (Exception e) {
|
||||||
|
// Ignore and treat as an old book
|
||||||
|
}
|
||||||
}
|
}
|
||||||
pageArray[i] = page;
|
pageArray[i] = page;
|
||||||
}
|
}
|
||||||
|
@ -39,7 +39,11 @@ class CraftMetaBookSigned extends CraftMetaBook implements BookMeta {
|
|||||||
for (int i = 0; i < pages.size(); i++) {
|
for (int i = 0; i < pages.size(); i++) {
|
||||||
String page = pages.getString(i);
|
String page = pages.getString(i);
|
||||||
if (resolved) {
|
if (resolved) {
|
||||||
|
try {
|
||||||
page = CraftChatMessage.fromComponent(ChatSerializer.a(page));
|
page = CraftChatMessage.fromComponent(ChatSerializer.a(page));
|
||||||
|
} catch (Exception e) {
|
||||||
|
// Ignore and treat as an old book
|
||||||
|
}
|
||||||
}
|
}
|
||||||
pageArray[i] = page;
|
pageArray[i] = page;
|
||||||
}
|
}
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren