SPIGOT-783: API for book generation data.

This commit is contained in:
Roy Curtis authored and md_5 committed 2016-06-03 20:41:28 +10:00
1 parent dd0e968c6a
commit cee5bbf00c
1 file changed
+10
@@ -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));