From cee5bbf00cfd56d31913683ca6e219d27ab03b91 Mon Sep 17 00:00:00 2001 From: Roy Curtis Date: Fri, 3 Jun 2016 00:10:06 +0100 Subject: [PATCH] SPIGOT-783: API for book generation data. --- .../bukkit/craftbukkit/inventory/CraftMetaBook.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBook.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBook.java index 0318958828..d517d7d587 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBook.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBook.java @@ -199,6 +199,16 @@ public class CraftMetaBook extends CraftMetaItem implements BookMeta { this.author = author; } + @Override + public Generation getGeneration() { + return (generation == null) ? null : Generation.values()[generation]; + } + + @Override + public void setGeneration(Generation generation) { + this.generation = (generation == null) ? null : generation.ordinal(); + } + public String getPage(final int page) { Validate.isTrue(isValidPage(page), "Invalid page number"); return CraftChatMessage.fromComponent(pages.get(page - 1));