SPIGOT-6911, #1349: Change max book length in CraftMetaBook

This commit is contained in:
DerFrZocker 2024-01-31 19:59:28 +11:00 committed by md_5
parent 333701839f
commit 3c1b778713
No known key found for this signature in database
GPG Key ID: E8E901AC7C617C11

View File

@ -13,6 +13,7 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList; import net.minecraft.nbt.NBTTagList;
import net.minecraft.nbt.NBTTagString; import net.minecraft.nbt.NBTTagString;
import net.minecraft.network.chat.IChatBaseComponent; import net.minecraft.network.chat.IChatBaseComponent;
import net.minecraft.world.item.ItemWrittenBook;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.configuration.serialization.DelegateDeserialization; import org.bukkit.configuration.serialization.DelegateDeserialization;
import org.bukkit.craftbukkit.inventory.CraftMetaItem.SerializableMeta; import org.bukkit.craftbukkit.inventory.CraftMetaItem.SerializableMeta;
@ -27,9 +28,9 @@ public class CraftMetaBook extends CraftMetaItem implements BookMeta {
static final ItemMetaKey BOOK_PAGES = new ItemMetaKey("pages"); static final ItemMetaKey BOOK_PAGES = new ItemMetaKey("pages");
static final ItemMetaKey RESOLVED = new ItemMetaKey("resolved"); static final ItemMetaKey RESOLVED = new ItemMetaKey("resolved");
static final ItemMetaKey GENERATION = new ItemMetaKey("generation"); static final ItemMetaKey GENERATION = new ItemMetaKey("generation");
static final int MAX_PAGES = 100; static final int MAX_PAGES = ItemWrittenBook.MAX_PAGES; // SPIGOT-6911: Use Minecraft limits
static final int MAX_PAGE_LENGTH = 320; // 256 limit + 64 characters to allow for psuedo colour codes static final int MAX_PAGE_LENGTH = ItemWrittenBook.PAGE_EDIT_LENGTH; // SPIGOT-6911: Use Minecraft limits
static final int MAX_TITLE_LENGTH = 32; static final int MAX_TITLE_LENGTH = ItemWrittenBook.TITLE_MAX_LENGTH; // SPIGOT-6911: Use Minecraft limits
protected String title; protected String title;
protected String author; protected String author;