mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-30 16:19:03 +01:00
Improve the Saddle API for Horses
Not all horses with Saddles have armor. This lets us break up the horses with saddles and access their saddle state separately from an interface shared with Armor.
This commit is contained in:
parent
48d1719745
commit
9895d6c5c3
4 changed files with 31 additions and 18 deletions
|
@ -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);
|
||||||
|
}
|
|
@ -5,20 +5,4 @@ import org.jetbrains.annotations.Nullable;
|
||||||
/**
|
/**
|
||||||
* An interface to the inventory of a Horse.
|
* An interface to the inventory of a Horse.
|
||||||
*/
|
*/
|
||||||
public interface HorseInventory extends AbstractHorseInventory {
|
public interface HorseInventory extends AbstractHorseInventory, ArmoredHorseInventory {}
|
||||||
|
|
||||||
/**
|
|
||||||
* 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);
|
|
||||||
}
|
|
||||||
|
|
|
@ -6,7 +6,7 @@ import org.jetbrains.annotations.Nullable;
|
||||||
/**
|
/**
|
||||||
* An interface to the inventory of a {@link Llama}.
|
* 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.
|
* Gets the item in the llama's decor slot.
|
||||||
|
|
|
@ -0,0 +1,7 @@
|
||||||
|
package org.bukkit.inventory;
|
||||||
|
|
||||||
|
import org.jspecify.annotations.NullMarked;
|
||||||
|
|
||||||
|
@NullMarked
|
||||||
|
public interface SaddledHorseInventory extends AbstractHorseInventory {
|
||||||
|
}
|
Loading…
Reference in a new issue