diff options
author | Wesley Wolfe <weswolf@aol.com> | 2012-12-27 10:45:56 -0600 |
---|---|---|
committer | Wesley Wolfe <weswolf@aol.com> | 2012-12-27 13:03:14 -0600 |
commit | ff54598b0546c41b7ae826fa2d802df44f3b86dd (patch) | |
tree | 717645f0237b9c513c3e2f0d01322d6f8580329d /src/main/java | |
parent | 782a2f3bf5a866d57291e61088d67283936a93e7 (diff) | |
download | bukkit-ff54598b0546c41b7ae826fa2d802df44f3b86dd.tar bukkit-ff54598b0546c41b7ae826fa2d802df44f3b86dd.tar.gz bukkit-ff54598b0546c41b7ae826fa2d802df44f3b86dd.tar.lz bukkit-ff54598b0546c41b7ae826fa2d802df44f3b86dd.tar.xz bukkit-ff54598b0546c41b7ae826fa2d802df44f3b86dd.zip |
Add method to get defult leather color. Adds BUKKIT-3203
The default leather color is already used internally in place of null. The
javadocs were updated appropriately to indicate as such.
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/org/bukkit/inventory/ItemFactory.java | 8 | ||||
-rw-r--r-- | src/main/java/org/bukkit/inventory/meta/LeatherArmorMeta.java | 7 |
2 files changed, 12 insertions, 3 deletions
diff --git a/src/main/java/org/bukkit/inventory/ItemFactory.java b/src/main/java/org/bukkit/inventory/ItemFactory.java index c6654c4a..58c2e17e 100644 --- a/src/main/java/org/bukkit/inventory/ItemFactory.java +++ b/src/main/java/org/bukkit/inventory/ItemFactory.java @@ -1,5 +1,6 @@ package org.bukkit.inventory; +import org.bukkit.Color; import org.bukkit.Material; import org.bukkit.Server; import org.bukkit.inventory.meta.BookMeta; @@ -79,4 +80,11 @@ public interface ItemFactory { * @throws IllegalArgumentException if the specified meta was not created by this factory */ ItemMeta asMetaFor(final ItemMeta meta, final Material material) throws IllegalArgumentException; + + /** + * Returns the default color for all leather armor. + * + * @return the default color for leather armor + */ + Color getDefaultLeatherColor(); } diff --git a/src/main/java/org/bukkit/inventory/meta/LeatherArmorMeta.java b/src/main/java/org/bukkit/inventory/meta/LeatherArmorMeta.java index 2ca6b6ec..01e23336 100644 --- a/src/main/java/org/bukkit/inventory/meta/LeatherArmorMeta.java +++ b/src/main/java/org/bukkit/inventory/meta/LeatherArmorMeta.java @@ -2,6 +2,7 @@ package org.bukkit.inventory.meta; import org.bukkit.Color; import org.bukkit.Material; +import org.bukkit.inventory.ItemFactory; /** * Represents leather armor ({@link Material#LEATHER_BOOTS}, {@link Material#LEATHER_CHESTPLATE}, {@link Material#LEATHER_HELMET}, or {@link Material#LEATHER_LEGGINGS}) that can be colored. @@ -9,16 +10,16 @@ import org.bukkit.Material; public interface LeatherArmorMeta extends ItemMeta { /** - * Gets the color of the armor + * Gets the color of the armor. If it has not been set otherwise, it will be {@link ItemFactory#getDefaultLeatherColor()}. * * @return the color of the armor, never null */ Color getColor(); /** - * Sets the color of the armor + * Sets the color of the armor. * - * @param color the color to set, null makes it the default leather color + * @param color the color to set. Setting it to null is equivalent to setting it to {@link ItemFactory#getDefaultLeatherColor()}. */ void setColor(Color color); |