public class PlayerInventoryMock extends InventoryMock implements org.bukkit.inventory.PlayerInventory
| Modifier and Type | Field and Description |
|---|---|
protected static int |
BOOTS |
protected static int |
CHESTPLATE |
protected static int |
HELMET |
protected static int |
HOTBAR |
protected static int |
LEGGINGS |
protected static int |
OFF_HAND |
protected static int |
SLOT_BAR |
| Constructor and Description |
|---|
PlayerInventoryMock(org.bukkit.entity.HumanEntity holder) |
| Modifier and Type | Method and Description |
|---|---|
org.bukkit.inventory.ItemStack[] |
getArmorContents() |
org.bukkit.inventory.ItemStack |
getBoots() |
org.bukkit.inventory.ItemStack |
getChestplate() |
org.bukkit.inventory.ItemStack[] |
getExtraContents() |
int |
getHeldItemSlot() |
org.bukkit.inventory.ItemStack |
getHelmet() |
org.bukkit.entity.HumanEntity |
getHolder() |
@Nullable org.bukkit.inventory.ItemStack |
getItem(@NotNull org.bukkit.inventory.EquipmentSlot slot)
Gets the
ItemStack at the given equipment slot in the inventory. |
@NotNull org.bukkit.inventory.ItemStack |
getItemInHand()
Deprecated.
|
@NotNull org.bukkit.inventory.ItemStack |
getItemInMainHand() |
@NotNull org.bukkit.inventory.ItemStack |
getItemInOffHand() |
org.bukkit.inventory.ItemStack |
getLeggings() |
org.bukkit.inventory.ItemStack[] |
getStorageContents() |
void |
setArmorContents(org.bukkit.inventory.ItemStack[] items) |
void |
setBoots(org.bukkit.inventory.ItemStack boots) |
void |
setChestplate(org.bukkit.inventory.ItemStack chestplate) |
void |
setExtraContents(org.bukkit.inventory.ItemStack[] items) |
void |
setHeldItemSlot(int slot) |
void |
setHelmet(org.bukkit.inventory.ItemStack helmet) |
void |
setItem(@NotNull org.bukkit.inventory.EquipmentSlot slot,
@Nullable org.bukkit.inventory.ItemStack item) |
void |
setItemInHand(org.bukkit.inventory.ItemStack stack)
Deprecated.
|
void |
setItemInMainHand(org.bukkit.inventory.ItemStack item) |
void |
setItemInOffHand(org.bukkit.inventory.ItemStack item) |
void |
setLeggings(org.bukkit.inventory.ItemStack leggings) |
void |
setStorageContents(org.bukkit.inventory.ItemStack[] items) |
addItem, addItem, all, all, assertContainsAny, assertContainsAtLeast, assertTrueForAll, assertTrueForNonNulls, assertTrueForSome, clear, clear, contains, contains, contains, contains, containsAtLeast, first, first, firstEmpty, getContents, getItem, getLocation, getMaxStackSize, getNumberOfItems, getSize, getSnapshot, getType, getViewers, isEmpty, iterator, iterator, remove, remove, removeItem, setContents, setItem, setMaxStackSizeclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddItem, all, all, clear, clear, contains, contains, contains, contains, containsAtLeast, first, first, firstEmpty, getContents, getItem, getLocation, getMaxStackSize, getSize, getType, getViewers, isEmpty, iterator, iterator, remove, remove, removeItem, setContents, setMaxStackSizeprotected static final int HOTBAR
protected static final int SLOT_BAR
protected static final int BOOTS
protected static final int LEGGINGS
protected static final int CHESTPLATE
protected static final int HELMET
protected static final int OFF_HAND
public PlayerInventoryMock(org.bukkit.entity.HumanEntity holder)
public org.bukkit.entity.HumanEntity getHolder()
getHolder in interface org.bukkit.inventory.InventorygetHolder in interface org.bukkit.inventory.PlayerInventorygetHolder in class InventoryMockpublic org.bukkit.inventory.ItemStack[] getStorageContents()
getStorageContents in interface org.bukkit.inventory.InventorygetStorageContents in class InventoryMockpublic void setStorageContents(org.bukkit.inventory.ItemStack[] items)
throws java.lang.IllegalArgumentException
setStorageContents in interface org.bukkit.inventory.InventorysetStorageContents in class InventoryMockjava.lang.IllegalArgumentExceptionpublic org.bukkit.inventory.ItemStack[] getArmorContents()
getArmorContents in interface org.bukkit.inventory.PlayerInventorypublic org.bukkit.inventory.ItemStack[] getExtraContents()
getExtraContents in interface org.bukkit.inventory.PlayerInventorypublic org.bukkit.inventory.ItemStack getHelmet()
getHelmet in interface org.bukkit.inventory.PlayerInventorypublic org.bukkit.inventory.ItemStack getChestplate()
getChestplate in interface org.bukkit.inventory.PlayerInventorypublic org.bukkit.inventory.ItemStack getLeggings()
getLeggings in interface org.bukkit.inventory.PlayerInventorypublic org.bukkit.inventory.ItemStack getBoots()
getBoots in interface org.bukkit.inventory.PlayerInventorypublic void setArmorContents(org.bukkit.inventory.ItemStack[] items)
setArmorContents in interface org.bukkit.inventory.PlayerInventorypublic void setExtraContents(org.bukkit.inventory.ItemStack[] items)
setExtraContents in interface org.bukkit.inventory.PlayerInventorypublic void setHelmet(org.bukkit.inventory.ItemStack helmet)
setHelmet in interface org.bukkit.inventory.PlayerInventorypublic void setChestplate(org.bukkit.inventory.ItemStack chestplate)
setChestplate in interface org.bukkit.inventory.PlayerInventorypublic void setLeggings(org.bukkit.inventory.ItemStack leggings)
setLeggings in interface org.bukkit.inventory.PlayerInventorypublic void setBoots(org.bukkit.inventory.ItemStack boots)
setBoots in interface org.bukkit.inventory.PlayerInventory@NotNull public @NotNull org.bukkit.inventory.ItemStack getItemInMainHand()
getItemInMainHand in interface org.bukkit.inventory.PlayerInventorypublic void setItemInMainHand(org.bukkit.inventory.ItemStack item)
setItemInMainHand in interface org.bukkit.inventory.PlayerInventory@NotNull public @NotNull org.bukkit.inventory.ItemStack getItemInOffHand()
getItemInOffHand in interface org.bukkit.inventory.PlayerInventorypublic void setItemInOffHand(org.bukkit.inventory.ItemStack item)
setItemInOffHand in interface org.bukkit.inventory.PlayerInventory@Deprecated @NotNull public @NotNull org.bukkit.inventory.ItemStack getItemInHand()
getItemInHand in interface org.bukkit.inventory.PlayerInventory@Deprecated public void setItemInHand(org.bukkit.inventory.ItemStack stack)
setItemInHand in interface org.bukkit.inventory.PlayerInventory@Nullable
public @Nullable org.bukkit.inventory.ItemStack getItem(@NotNull
@NotNull org.bukkit.inventory.EquipmentSlot slot)
ItemStack at the given equipment slot in the inventory.
Implementation note: only the contents of the main hand
and the off hand are guaranteed not to be null,
despite the annotation present in the Bukkit api.
getItem in interface org.bukkit.inventory.PlayerInventoryslot - the slot to get the ItemStackItemStack in the given slotpublic void setItem(@NotNull
@NotNull org.bukkit.inventory.EquipmentSlot slot,
@Nullable
@Nullable org.bukkit.inventory.ItemStack item)
setItem in interface org.bukkit.inventory.PlayerInventorypublic int getHeldItemSlot()
getHeldItemSlot in interface org.bukkit.inventory.PlayerInventorypublic void setHeldItemSlot(int slot)
setHeldItemSlot in interface org.bukkit.inventory.PlayerInventory