diff --git a/paper-api/src/main/java/org/bukkit/inventory/ItemFactory.java b/paper-api/src/main/java/org/bukkit/inventory/ItemFactory.java index c6654c4aff..58c2e17e51 100644 --- a/paper-api/src/main/java/org/bukkit/inventory/ItemFactory.java +++ b/paper-api/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/paper-api/src/main/java/org/bukkit/inventory/meta/LeatherArmorMeta.java b/paper-api/src/main/java/org/bukkit/inventory/meta/LeatherArmorMeta.java index 2ca6b6ecee..01e23336d7 100644 --- a/paper-api/src/main/java/org/bukkit/inventory/meta/LeatherArmorMeta.java +++ b/paper-api/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);