Class PlayerInventory

java.lang.Object
com.loohp.limbo.inventory.AbstractInventory
com.loohp.limbo.player.PlayerInventory
All Implemented Interfaces:
EntityEquipment, Inventory, Iterable<ItemStack>

public class PlayerInventory extends AbstractInventory implements EntityEquipment
  • Constructor Details

    • PlayerInventory

      public PlayerInventory(Player player)
  • Method Details

    • getHolder

      public Player getHolder()
      Description copied from interface: Inventory
      Gets the block or entity belonging to the open inventory
      Specified by:
      getHolder in interface EntityEquipment
      Specified by:
      getHolder in interface Inventory
      Overrides:
      getHolder in class AbstractInventory
      Returns:
      The holder of the inventory; null if it has no holder.
    • setItem

      public void setItem(EquipmentSlot slot, ItemStack item)
      Description copied from interface: EntityEquipment
      Stores the ItemStack at the given equipment slot in the inventory.
      Specified by:
      setItem in interface EntityEquipment
      Parameters:
      slot - the slot to put the ItemStack
      item - the ItemStack to set
    • getItem

      public ItemStack getItem(EquipmentSlot slot)
      Description copied from interface: EntityEquipment
      Gets the ItemStack at the given equipment slot in the inventory.
      Specified by:
      getItem in interface EntityEquipment
      Parameters:
      slot - the slot to get the ItemStack
      Returns:
      the ItemStack in the given slot
    • getItemInMainHand

      public ItemStack getItemInMainHand()
      Description copied from interface: EntityEquipment
      Gets a copy of the item the entity is currently holding in their main hand.
      Specified by:
      getItemInMainHand in interface EntityEquipment
      Returns:
      the currently held item
    • setItemInMainHand

      public void setItemInMainHand(ItemStack item)
      Description copied from interface: EntityEquipment
      Sets the item the entity is holding in their main hand.
      Specified by:
      setItemInMainHand in interface EntityEquipment
      Parameters:
      item - The item to put into the entities hand
    • getItemInOffHand

      public ItemStack getItemInOffHand()
      Description copied from interface: EntityEquipment
      Gets a copy of the item the entity is currently holding in their off hand.
      Specified by:
      getItemInOffHand in interface EntityEquipment
      Returns:
      the currently held item
    • setItemInOffHand

      public void setItemInOffHand(ItemStack item)
      Description copied from interface: EntityEquipment
      Sets the item the entity is holding in their off hand.
      Specified by:
      setItemInOffHand in interface EntityEquipment
      Parameters:
      item - The item to put into the entities hand
    • getHelmet

      public ItemStack getHelmet()
      Description copied from interface: EntityEquipment
      Gets a copy of the helmet currently being worn by the entity
      Specified by:
      getHelmet in interface EntityEquipment
      Returns:
      The helmet being worn
    • setHelmet

      public void setHelmet(ItemStack helmet)
      Description copied from interface: EntityEquipment
      Sets the helmet worn by the entity
      Specified by:
      setHelmet in interface EntityEquipment
      Parameters:
      helmet - The helmet to put on the entity
    • getChestplate

      public ItemStack getChestplate()
      Description copied from interface: EntityEquipment
      Gets a copy of the chest plate currently being worn by the entity
      Specified by:
      getChestplate in interface EntityEquipment
      Returns:
      The chest plate being worn
    • setChestplate

      public void setChestplate(ItemStack chestplate)
      Description copied from interface: EntityEquipment
      Sets the chest plate worn by the entity
      Specified by:
      setChestplate in interface EntityEquipment
      Parameters:
      chestplate - The chest plate to put on the entity
    • getLeggings

      public ItemStack getLeggings()
      Description copied from interface: EntityEquipment
      Gets a copy of the leggings currently being worn by the entity
      Specified by:
      getLeggings in interface EntityEquipment
      Returns:
      The leggings being worn
    • setLeggings

      public void setLeggings(ItemStack leggings)
      Description copied from interface: EntityEquipment
      Sets the leggings worn by the entity
      Specified by:
      setLeggings in interface EntityEquipment
      Parameters:
      leggings - The leggings to put on the entity
    • getBoots

      public ItemStack getBoots()
      Description copied from interface: EntityEquipment
      Gets a copy of the boots currently being worn by the entity
      Specified by:
      getBoots in interface EntityEquipment
      Returns:
      The boots being worn
    • setBoots

      public void setBoots(ItemStack boots)
      Description copied from interface: EntityEquipment
      Sets the boots worn by the entity
      Specified by:
      setBoots in interface EntityEquipment
      Parameters:
      boots - The boots to put on the entity
    • getArmorContents

      public ItemStack[] getArmorContents()
      Description copied from interface: EntityEquipment
      Gets a copy of all worn armor
      Specified by:
      getArmorContents in interface EntityEquipment
      Returns:
      The array of worn armor. Individual items may be null.
    • setArmorContents

      public void setArmorContents(ItemStack[] items)
      Description copied from interface: EntityEquipment
      Sets the entities armor to the provided array of ItemStacks
      Specified by:
      setArmorContents in interface EntityEquipment
      Parameters:
      items - The items to set the armor as. Individual items may be null.