geforkt von Mirrors/Paper
Restore null page behaviour of signed books even though not strictly allowed by API
By: md_5 <git@md-5.net>
Dieser Commit ist enthalten in:
Ursprung
e01dc013f7
Commit
17b4c0d7a3
@ -212,7 +212,7 @@ public class CraftMetaBookSigned extends CraftMetaItem implements BookMeta {
|
|||||||
// assert: pages != null
|
// assert: pages != null
|
||||||
|
|
||||||
String newText = validatePage(text);
|
String newText = validatePage(text);
|
||||||
pages.set(page - 1, CraftChatMessage.fromStringOrNull(newText, true));
|
pages.set(page - 1, CraftChatMessage.fromStringOrEmpty(newText, true));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -224,7 +224,7 @@ public class CraftMetaBookSigned extends CraftMetaItem implements BookMeta {
|
|||||||
public void addPage(final String... pages) {
|
public void addPage(final String... pages) {
|
||||||
for (String page : pages) {
|
for (String page : pages) {
|
||||||
page = validatePage(page);
|
page = validatePage(page);
|
||||||
internalAddPage(CraftChatMessage.fromStringOrNull(page, true));
|
internalAddPage(CraftChatMessage.fromStringOrEmpty(page, true));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -177,6 +177,14 @@ public final class CraftChatMessage {
|
|||||||
return (message == null || message.isEmpty()) ? null : fromString(message, keepNewlines)[0];
|
return (message == null || message.isEmpty()) ? null : fromString(message, keepNewlines)[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static IChatBaseComponent fromStringOrEmpty(String message) {
|
||||||
|
return fromStringOrEmpty(message, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static IChatBaseComponent fromStringOrEmpty(String message, boolean keepNewlines) {
|
||||||
|
return fromString(message, keepNewlines)[0];
|
||||||
|
}
|
||||||
|
|
||||||
public static IChatBaseComponent[] fromString(String message) {
|
public static IChatBaseComponent[] fromString(String message) {
|
||||||
return fromString(message, false);
|
return fromString(message, false);
|
||||||
}
|
}
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren