SPIGOT-2623: Add EntityEquipment methods to get/set ItemStacks by slot.

By: blablubbabc <lukas@wirsindwir.de>
This commit is contained in:
Bukkit/Spigot 2020-06-13 20:56:29 +10:00
parent f8ce884be6
commit 40d09ae808

View file

@ -9,6 +9,23 @@ import org.jetbrains.annotations.Nullable;
*/
public interface EntityEquipment {
/**
* Stores the ItemStack at the given equipment slot in the inventory.
*
* @param slot the slot to put the ItemStack
* @param item the ItemStack to set
*/
public void setItem(@NotNull EquipmentSlot slot, @Nullable ItemStack item);
/**
* Gets the ItemStack at the given equipment slot in the inventory.
*
* @param slot the slot to get the ItemStack
* @return the ItemStack in the given slot
*/
@NotNull
public ItemStack getItem(@NotNull EquipmentSlot slot);
/**
* Gets a copy of the item the entity is currently holding
* in their main hand.