Class PlayerInventory

java.lang.Object
fr.fidorial.inventory.SimpleContainer
fr.fidorial.inventory.PlayerInventory
All Implemented Interfaces:
Container

public class PlayerInventory extends SimpleContainer
The inventory a player carries.

Slots are laid out as follows: the hotbar from 0 to 8, the main inventory from 9 to 35, the armor from 36 (feet) to 39 (head), then the off hand at 40. The remaining slots are reserved.

Since:
0.1.0
See Also:
  • Field Details

    • SIZE

      public static final int SIZE
      The number of slots of a player inventory, reserved ones included.
      Since:
      0.1.0
      See Also:
    • HOTBAR_START

      public static final int HOTBAR_START
      The first hotbar slot.
      Since:
      0.1.0
      See Also:
    • HOTBAR_SIZE

      public static final int HOTBAR_SIZE
      The number of hotbar slots.
      Since:
      0.1.0
      See Also:
    • MAIN_START

      public static final int MAIN_START
      The first slot of the main inventory, right after the hotbar.
      Since:
      0.1.0
      See Also:
    • FEET

      public static final int FEET
      The boots slot.
      Since:
      0.1.0
      See Also:
    • LEGS

      public static final int LEGS
      The leggings slot.
      Since:
      0.1.0
      See Also:
    • CHEST

      public static final int CHEST
      The chestplate slot.
      Since:
      0.1.0
      See Also:
    • OFF_HAND

      public static final int OFF_HAND
      The off hand slot.
      Since:
      0.1.0
      See Also:
  • Constructor Details

    • PlayerInventory

      public PlayerInventory()
      Creates an empty inventory.
      Since:
      0.1.0