Class PlayerInventoryMock

java.lang.Object
be.seeseemelk.mockbukkit.inventory.InventoryMock
be.seeseemelk.mockbukkit.inventory.PlayerInventoryMock
All Implemented Interfaces:
Iterable<org.bukkit.inventory.ItemStack>, org.bukkit.inventory.EntityEquipment, org.bukkit.inventory.Inventory, org.bukkit.inventory.PlayerInventory

public class PlayerInventoryMock extends InventoryMock implements org.bukkit.inventory.PlayerInventory, org.bukkit.inventory.EntityEquipment
Mock implementation of a PlayerInventory.
See Also:
  • Field Details

    • HOTBAR

      protected static final int HOTBAR
      The starting slot of the hotbar.
      See Also:
    • SLOT_BAR

      protected static final int SLOT_BAR
      The ending slot of the hotbar.
      See Also:
    • BOOTS

      protected static final int BOOTS
      The slot boots are in.
      See Also:
    • LEGGINGS

      protected static final int LEGGINGS
      The slot leggings are in.
      See Also:
    • CHESTPLATE

      protected static final int CHESTPLATE
      The slot the chestplate is in.
      See Also:
    • HELMET

      protected static final int HELMET
      The slot the helmet is in.
      See Also:
    • OFF_HAND

      protected static final int OFF_HAND
      The slot of the offhand.
      See Also:
  • Constructor Details

    • PlayerInventoryMock

      public PlayerInventoryMock(org.bukkit.entity.HumanEntity holder)
      Constructs a new PlayerInventoryMock.
      Parameters:
      holder - The holder of the inventory.
  • Method Details

    • getHolder

      public org.bukkit.entity.HumanEntity getHolder()
      Specified by:
      getHolder in interface org.bukkit.inventory.EntityEquipment
      Specified by:
      getHolder in interface org.bukkit.inventory.Inventory
      Specified by:
      getHolder in interface org.bukkit.inventory.PlayerInventory
      Overrides:
      getHolder in class InventoryMock
    • getStorageContents

      public org.bukkit.inventory.ItemStack @NotNull [] getStorageContents()
      Specified by:
      getStorageContents in interface org.bukkit.inventory.Inventory
      Overrides:
      getStorageContents in class InventoryMock
    • setStorageContents

      public void setStorageContents(org.bukkit.inventory.ItemStack[] items) throws IllegalArgumentException
      Specified by:
      setStorageContents in interface org.bukkit.inventory.Inventory
      Overrides:
      setStorageContents in class InventoryMock
      Throws:
      IllegalArgumentException
    • getArmorContents

      public org.bukkit.inventory.ItemStack @NotNull [] getArmorContents()
      Specified by:
      getArmorContents in interface org.bukkit.inventory.EntityEquipment
      Specified by:
      getArmorContents in interface org.bukkit.inventory.PlayerInventory
    • getExtraContents

      public org.bukkit.inventory.ItemStack @NotNull [] getExtraContents()
      Specified by:
      getExtraContents in interface org.bukkit.inventory.PlayerInventory
    • getHelmet

      @Nullable public @Nullable org.bukkit.inventory.ItemStack getHelmet()
      Specified by:
      getHelmet in interface org.bukkit.inventory.EntityEquipment
      Specified by:
      getHelmet in interface org.bukkit.inventory.PlayerInventory
    • getChestplate

      @Nullable public @Nullable org.bukkit.inventory.ItemStack getChestplate()
      Specified by:
      getChestplate in interface org.bukkit.inventory.EntityEquipment
      Specified by:
      getChestplate in interface org.bukkit.inventory.PlayerInventory
    • getLeggings

      @Nullable public @Nullable org.bukkit.inventory.ItemStack getLeggings()
      Specified by:
      getLeggings in interface org.bukkit.inventory.EntityEquipment
      Specified by:
      getLeggings in interface org.bukkit.inventory.PlayerInventory
    • getBoots

      @Nullable public @Nullable org.bukkit.inventory.ItemStack getBoots()
      Specified by:
      getBoots in interface org.bukkit.inventory.EntityEquipment
      Specified by:
      getBoots in interface org.bukkit.inventory.PlayerInventory
    • setArmorContents

      public void setArmorContents(org.bukkit.inventory.ItemStack @Nullable [] items)
      Specified by:
      setArmorContents in interface org.bukkit.inventory.EntityEquipment
      Specified by:
      setArmorContents in interface org.bukkit.inventory.PlayerInventory
    • getItemInHandDropChance

      public float getItemInHandDropChance()
      Specified by:
      getItemInHandDropChance in interface org.bukkit.inventory.EntityEquipment
    • setItemInHandDropChance

      public void setItemInHandDropChance(float chance)
      Specified by:
      setItemInHandDropChance in interface org.bukkit.inventory.EntityEquipment
    • getItemInMainHandDropChance

      public float getItemInMainHandDropChance()
      Specified by:
      getItemInMainHandDropChance in interface org.bukkit.inventory.EntityEquipment
    • setItemInMainHandDropChance

      public void setItemInMainHandDropChance(float chance)
      Specified by:
      setItemInMainHandDropChance in interface org.bukkit.inventory.EntityEquipment
    • getItemInOffHandDropChance

      public float getItemInOffHandDropChance()
      Specified by:
      getItemInOffHandDropChance in interface org.bukkit.inventory.EntityEquipment
    • setItemInOffHandDropChance

      public void setItemInOffHandDropChance(float chance)
      Specified by:
      setItemInOffHandDropChance in interface org.bukkit.inventory.EntityEquipment
    • getHelmetDropChance

      public float getHelmetDropChance()
      Specified by:
      getHelmetDropChance in interface org.bukkit.inventory.EntityEquipment
    • setHelmetDropChance

      public void setHelmetDropChance(float chance)
      Specified by:
      setHelmetDropChance in interface org.bukkit.inventory.EntityEquipment
    • getChestplateDropChance

      public float getChestplateDropChance()
      Specified by:
      getChestplateDropChance in interface org.bukkit.inventory.EntityEquipment
    • setChestplateDropChance

      public void setChestplateDropChance(float chance)
      Specified by:
      setChestplateDropChance in interface org.bukkit.inventory.EntityEquipment
    • getLeggingsDropChance

      public float getLeggingsDropChance()
      Specified by:
      getLeggingsDropChance in interface org.bukkit.inventory.EntityEquipment
    • setLeggingsDropChance

      public void setLeggingsDropChance(float chance)
      Specified by:
      setLeggingsDropChance in interface org.bukkit.inventory.EntityEquipment
    • getBootsDropChance

      public float getBootsDropChance()
      Specified by:
      getBootsDropChance in interface org.bukkit.inventory.EntityEquipment
    • setBootsDropChance

      public void setBootsDropChance(float chance)
      Specified by:
      setBootsDropChance in interface org.bukkit.inventory.EntityEquipment
    • setExtraContents

      public void setExtraContents(org.bukkit.inventory.ItemStack @Nullable [] items)
      Specified by:
      setExtraContents in interface org.bukkit.inventory.PlayerInventory
    • setHelmet

      public void setHelmet(org.bukkit.inventory.ItemStack helmet)
      Specified by:
      setHelmet in interface org.bukkit.inventory.EntityEquipment
      Specified by:
      setHelmet in interface org.bukkit.inventory.PlayerInventory
    • setHelmet

      public void setHelmet(@Nullable @Nullable org.bukkit.inventory.ItemStack helmet, boolean silent)
      Specified by:
      setHelmet in interface org.bukkit.inventory.EntityEquipment
    • setChestplate

      public void setChestplate(org.bukkit.inventory.ItemStack chestplate)
      Specified by:
      setChestplate in interface org.bukkit.inventory.EntityEquipment
      Specified by:
      setChestplate in interface org.bukkit.inventory.PlayerInventory
    • setChestplate

      public void setChestplate(@Nullable @Nullable org.bukkit.inventory.ItemStack chestplate, boolean silent)
      Specified by:
      setChestplate in interface org.bukkit.inventory.EntityEquipment
    • setLeggings

      public void setLeggings(org.bukkit.inventory.ItemStack leggings)
      Specified by:
      setLeggings in interface org.bukkit.inventory.EntityEquipment
      Specified by:
      setLeggings in interface org.bukkit.inventory.PlayerInventory
    • setLeggings

      public void setLeggings(@Nullable @Nullable org.bukkit.inventory.ItemStack leggings, boolean silent)
      Specified by:
      setLeggings in interface org.bukkit.inventory.EntityEquipment
    • setBoots

      public void setBoots(org.bukkit.inventory.ItemStack boots)
      Specified by:
      setBoots in interface org.bukkit.inventory.EntityEquipment
      Specified by:
      setBoots in interface org.bukkit.inventory.PlayerInventory
    • setBoots

      public void setBoots(@Nullable @Nullable org.bukkit.inventory.ItemStack boots, boolean silent)
      Specified by:
      setBoots in interface org.bukkit.inventory.EntityEquipment
    • getItemInMainHand

      @NotNull public @NotNull org.bukkit.inventory.ItemStack getItemInMainHand()
      Specified by:
      getItemInMainHand in interface org.bukkit.inventory.EntityEquipment
      Specified by:
      getItemInMainHand in interface org.bukkit.inventory.PlayerInventory
    • setItemInMainHand

      public void setItemInMainHand(org.bukkit.inventory.ItemStack item)
      Specified by:
      setItemInMainHand in interface org.bukkit.inventory.EntityEquipment
      Specified by:
      setItemInMainHand in interface org.bukkit.inventory.PlayerInventory
    • setItemInMainHand

      public void setItemInMainHand(@Nullable @Nullable org.bukkit.inventory.ItemStack item, boolean silent)
      Specified by:
      setItemInMainHand in interface org.bukkit.inventory.EntityEquipment
    • getItemInOffHand

      @NotNull public @NotNull org.bukkit.inventory.ItemStack getItemInOffHand()
      Specified by:
      getItemInOffHand in interface org.bukkit.inventory.EntityEquipment
      Specified by:
      getItemInOffHand in interface org.bukkit.inventory.PlayerInventory
    • setItemInOffHand

      public void setItemInOffHand(org.bukkit.inventory.ItemStack item)
      Specified by:
      setItemInOffHand in interface org.bukkit.inventory.EntityEquipment
      Specified by:
      setItemInOffHand in interface org.bukkit.inventory.PlayerInventory
    • setItemInOffHand

      public void setItemInOffHand(@Nullable @Nullable org.bukkit.inventory.ItemStack item, boolean silent)
      Specified by:
      setItemInOffHand in interface org.bukkit.inventory.EntityEquipment
    • getItemInHand

      @Deprecated @NotNull public @NotNull org.bukkit.inventory.ItemStack getItemInHand()
      Deprecated.
      Specified by:
      getItemInHand in interface org.bukkit.inventory.EntityEquipment
      Specified by:
      getItemInHand in interface org.bukkit.inventory.PlayerInventory
    • setItemInHand

      @Deprecated public void setItemInHand(org.bukkit.inventory.ItemStack stack)
      Deprecated.
      Specified by:
      setItemInHand in interface org.bukkit.inventory.EntityEquipment
      Specified by:
      setItemInHand in interface org.bukkit.inventory.PlayerInventory
    • getItem

      @NotNull public @NotNull org.bukkit.inventory.ItemStack getItem(@NotNull @NotNull org.bukkit.inventory.EquipmentSlot slot)
      Specified by:
      getItem in interface org.bukkit.inventory.EntityEquipment
      Specified by:
      getItem in interface org.bukkit.inventory.PlayerInventory
    • setItem

      public void setItem(@NotNull @NotNull org.bukkit.inventory.EquipmentSlot slot, @Nullable @Nullable org.bukkit.inventory.ItemStack item)
      Specified by:
      setItem in interface org.bukkit.inventory.EntityEquipment
      Specified by:
      setItem in interface org.bukkit.inventory.PlayerInventory
    • setItem

      public void setItem(@NotNull @NotNull org.bukkit.inventory.EquipmentSlot slot, @Nullable @Nullable org.bukkit.inventory.ItemStack item, boolean silent)
      Specified by:
      setItem in interface org.bukkit.inventory.EntityEquipment
    • getHeldItemSlot

      public int getHeldItemSlot()
      Specified by:
      getHeldItemSlot in interface org.bukkit.inventory.PlayerInventory
    • setHeldItemSlot

      public void setHeldItemSlot(int slot)
      Specified by:
      setHeldItemSlot in interface org.bukkit.inventory.PlayerInventory
    • getDropChance

      public float getDropChance(@NotNull @NotNull org.bukkit.inventory.EquipmentSlot slot)
      Specified by:
      getDropChance in interface org.bukkit.inventory.EntityEquipment
    • setDropChance

      public void setDropChance(@NotNull @NotNull org.bukkit.inventory.EquipmentSlot slot, float chance)
      Specified by:
      setDropChance in interface org.bukkit.inventory.EntityEquipment