diff --git a/src/main/java/org/bukkit/entity/Wolf.java b/src/main/java/org/bukkit/entity/Wolf.java index 91e96ee5..27cb2abb 100644 --- a/src/main/java/org/bukkit/entity/Wolf.java +++ b/src/main/java/org/bukkit/entity/Wolf.java @@ -4,12 +4,15 @@ import org.bukkit.DyeColor; import org.bukkit.Keyed; import org.bukkit.NamespacedKey; import org.bukkit.Registry; +import org.bukkit.inventory.Inventory; +import org.bukkit.inventory.InventoryHolder; +import org.bukkit.inventory.WolfInventory; import org.jetbrains.annotations.NotNull; /** * Represents a Wolf */ -public interface Wolf extends Tameable, Sittable { +public interface Wolf extends Tameable, Sittable, InventoryHolder { /** * Checks if this wolf is angry @@ -86,6 +89,10 @@ public interface Wolf extends Tameable, Sittable { */ void setVariant(@NotNull Variant variant); + @NotNull + @Override + WolfInventory getInventory(); + /** * Represents the variant of a wolf. */ diff --git a/src/main/java/org/bukkit/inventory/BodyArmorInventory.java b/src/main/java/org/bukkit/inventory/BodyArmorInventory.java new file mode 100644 index 00000000..08652f0b --- /dev/null +++ b/src/main/java/org/bukkit/inventory/BodyArmorInventory.java @@ -0,0 +1,25 @@ +package org.bukkit.inventory; + +import org.jetbrains.annotations.Nullable; + +/** + * An interface to the inventory of an entity capable of holding body armor (wolves, horses, etc.). + */ +public interface BodyArmorInventory extends Inventory { + + /** + * Gets the item in the entity's body armor slot. + * + * @return the armor item + */ + @Nullable + ItemStack getArmor(); + + /** + * Sets the item in the entity's body armor slot. + * + * @param stack the new item + */ + void setArmor(@Nullable ItemStack stack); + +} diff --git a/src/main/java/org/bukkit/inventory/HorseInventory.java b/src/main/java/org/bukkit/inventory/HorseInventory.java index 608e99c4..2c1c9dd9 100644 --- a/src/main/java/org/bukkit/inventory/HorseInventory.java +++ b/src/main/java/org/bukkit/inventory/HorseInventory.java @@ -1,24 +1,7 @@ package org.bukkit.inventory; -import org.jetbrains.annotations.Nullable; - /** * An interface to the inventory of a Horse. */ -public interface HorseInventory extends AbstractHorseInventory { - - /** - * Gets the item in the horse's armor slot. - * - * @return the armor item - */ - @Nullable - ItemStack getArmor(); - - /** - * Sets the item in the horse's armor slot. - * - * @param stack the new item - */ - void setArmor(@Nullable ItemStack stack); +public interface HorseInventory extends AbstractHorseInventory, BodyArmorInventory { } diff --git a/src/main/java/org/bukkit/inventory/WolfInventory.java b/src/main/java/org/bukkit/inventory/WolfInventory.java new file mode 100644 index 00000000..f789b66d --- /dev/null +++ b/src/main/java/org/bukkit/inventory/WolfInventory.java @@ -0,0 +1,7 @@ +package org.bukkit.inventory; + +/** + * An interface to the inventory of a Wolf. + */ +public interface WolfInventory extends BodyArmorInventory { +}