summaryrefslogtreecommitdiffstats
path: root/src/main/java
diff options
context:
space:
mode:
authorRoy Curtis <roy.adrian.curtis+github@gmail.com>2016-06-14 22:21:06 +0100
committermd_5 <git@md-5.net>2016-06-16 10:50:08 +1000
commiteb9f4ee387c12e0179e32cd581575d79d2b93ec5 (patch)
tree9e7946dacb095be6672cb38769e6ad35470c10a3 /src/main/java
parent268e8e7836982a63dea448c0ef6f4dae020de23a (diff)
downloadbukkit-eb9f4ee387c12e0179e32cd581575d79d2b93ec5.tar
bukkit-eb9f4ee387c12e0179e32cd581575d79d2b93ec5.tar.gz
bukkit-eb9f4ee387c12e0179e32cd581575d79d2b93ec5.tar.lz
bukkit-eb9f4ee387c12e0179e32cd581575d79d2b93ec5.tar.xz
bukkit-eb9f4ee387c12e0179e32cd581575d79d2b93ec5.zip
Improvements to BookMeta API
* Added hasGeneration() * Corrected javadoc of methods for consistency and accuracy according to CraftBukkit behavior
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/org/bukkit/inventory/meta/BookMeta.java24
1 files changed, 16 insertions, 8 deletions
diff --git a/src/main/java/org/bukkit/inventory/meta/BookMeta.java b/src/main/java/org/bukkit/inventory/meta/BookMeta.java
index 845f71c4..d66e3f59 100644
--- a/src/main/java/org/bukkit/inventory/meta/BookMeta.java
+++ b/src/main/java/org/bukkit/inventory/meta/BookMeta.java
@@ -62,7 +62,7 @@ public interface BookMeta extends ItemMeta {
/**
* Checks for the existence of an author in the book.
*
- * @return the author of the book
+ * @return true if the book has an author
*/
boolean hasAuthor();
@@ -79,23 +79,31 @@ public interface BookMeta extends ItemMeta {
/**
* Sets the author of the book. Removes author when given null.
*
- * @param author the author of the book
+ * @param author the author to set
*/
void setAuthor(String author);
/**
- * Gets the generation of the book, or null if it's out of bounds.
+ * Checks for the existence of generation level in the book.
*
- * @return the generation of the book or null
+ * @return true if the book has a generation level
*/
- Generation getGeneration();
+ boolean hasGeneration();
/**
- * Sets the generation of the book.
+ * Gets the generation of the book.
* <p>
- * Assumes Generation.ORIGINAL if given null.
+ * Plugins should check that hasGeneration() returns true before calling
+ * this method.
+ *
+ * @return the generation of the book
+ */
+ Generation getGeneration();
+
+ /**
+ * Sets the generation of the book. Removes generation when given null.
*
- * @param generation the generation of the book
+ * @param generation the generation to set
*/
void setGeneration(Generation generation);