diff options
author | Roy Curtis <roy.adrian.curtis+github@gmail.com> | 2016-06-01 17:55:13 +0100 |
---|---|---|
committer | md_5 <git@md-5.net> | 2016-06-03 20:38:40 +1000 |
commit | 434c29cbe18537e193927375d15741935eb84d3b (patch) | |
tree | 86346e41af0e8e54503cd95afb31a1cdd9f9ea84 /src/main/java | |
parent | 688d644007e3f18ae173370bd49662299e0fb452 (diff) | |
download | bukkit-434c29cbe18537e193927375d15741935eb84d3b.tar bukkit-434c29cbe18537e193927375d15741935eb84d3b.tar.gz bukkit-434c29cbe18537e193927375d15741935eb84d3b.tar.lz bukkit-434c29cbe18537e193927375d15741935eb84d3b.tar.xz bukkit-434c29cbe18537e193927375d15741935eb84d3b.zip |
SPIGOT-783: API for book generation data.
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/org/bukkit/inventory/meta/BookMeta.java | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/src/main/java/org/bukkit/inventory/meta/BookMeta.java b/src/main/java/org/bukkit/inventory/meta/BookMeta.java index 00175963..845f71c4 100644 --- a/src/main/java/org/bukkit/inventory/meta/BookMeta.java +++ b/src/main/java/org/bukkit/inventory/meta/BookMeta.java @@ -11,6 +11,28 @@ import org.bukkit.Material; public interface BookMeta extends ItemMeta { /** + * Represents the generation (or level of copying) of a written book + */ + enum Generation { + /** + * Book written into a book-and-quill. Can be copied. (Default value) + */ + ORIGINAL, + /** + * Book that was copied from an original. Can be copied. + */ + COPY_OF_ORIGINAL, + /** + * Book that was copied from a copy of an original. Can't be copied. + */ + COPY_OF_COPY, + /** + * Unused; unobtainable by players. Can't be copied. + */ + TATTERED; + } + + /** * Checks for the existence of a title in the book. * * @return true if the book has a title @@ -62,6 +84,22 @@ public interface BookMeta extends ItemMeta { void setAuthor(String author); /** + * Gets the generation of the book, or null if it's out of bounds. + * + * @return the generation of the book or null + */ + Generation getGeneration(); + + /** + * Sets the generation of the book. + * <p> + * Assumes Generation.ORIGINAL if given null. + * + * @param generation the generation of the book + */ + void setGeneration(Generation generation); + + /** * Checks for the existence of pages in the book. * * @return true if the book has pages |