diff --git a/paper-api/src/main/java/org/bukkit/inventory/ArmoredHorseInventory.java b/paper-api/src/main/java/org/bukkit/inventory/ArmoredHorseInventory.java new file mode 100644 index 0000000000..994f34ac20 --- /dev/null +++ b/paper-api/src/main/java/org/bukkit/inventory/ArmoredHorseInventory.java @@ -0,0 +1,22 @@ +package org.bukkit.inventory; + +import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; + +@NullMarked +public interface ArmoredHorseInventory 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); +} diff --git a/paper-api/src/main/java/org/bukkit/inventory/HorseInventory.java b/paper-api/src/main/java/org/bukkit/inventory/HorseInventory.java index 608e99c420..53498debe4 100644 --- a/paper-api/src/main/java/org/bukkit/inventory/HorseInventory.java +++ b/paper-api/src/main/java/org/bukkit/inventory/HorseInventory.java @@ -5,20 +5,4 @@ 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, ArmoredHorseInventory {} diff --git a/paper-api/src/main/java/org/bukkit/inventory/LlamaInventory.java b/paper-api/src/main/java/org/bukkit/inventory/LlamaInventory.java index 2fa2c9d07e..5ac1afb8a2 100644 --- a/paper-api/src/main/java/org/bukkit/inventory/LlamaInventory.java +++ b/paper-api/src/main/java/org/bukkit/inventory/LlamaInventory.java @@ -6,7 +6,7 @@ import org.jetbrains.annotations.Nullable; /** * An interface to the inventory of a {@link Llama}. */ -public interface LlamaInventory extends AbstractHorseInventory { +public interface LlamaInventory extends SaddledHorseInventory { /** * Gets the item in the llama's decor slot. diff --git a/paper-api/src/main/java/org/bukkit/inventory/SaddledHorseInventory.java b/paper-api/src/main/java/org/bukkit/inventory/SaddledHorseInventory.java new file mode 100644 index 0000000000..0f508a8df8 --- /dev/null +++ b/paper-api/src/main/java/org/bukkit/inventory/SaddledHorseInventory.java @@ -0,0 +1,7 @@ +package org.bukkit.inventory; + +import org.jspecify.annotations.NullMarked; + +@NullMarked +public interface SaddledHorseInventory extends AbstractHorseInventory { +}