Enum Class PlayerInventorySlot

java.lang.Object
java.lang.Enum<PlayerInventorySlot>
com.janboerman.invsee.spigot.api.template.PlayerInventorySlot
All Implemented Interfaces:
Serializable, Comparable<PlayerInventorySlot>, Constable

public enum PlayerInventorySlot extends Enum<PlayerInventorySlot>
Represents a slot of a MainSpectatorInventory.
  • Enum Constant Details

  • Method Details

    • values

      public static PlayerInventorySlot[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static PlayerInventorySlot valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • isContainer

      public boolean isContainer()
      Get whether this slot is a regular container slot.
      Returns:
      true if this slot is a container slot, otherwise false
    • isArmour

      public boolean isArmour()
      Get whether this slot is an armour slot.
      Returns:
      true if this slot is an armour slot, otherwise false
      API Note:
      the OFFHAND slot is NOT considered an armour slot.
    • isPersonal

      public boolean isPersonal()
      Get whether this slot is a personal slot. Personal slots are slots which host items that are personal to the player, such as crafting slots, enchanting window and villager working block windows.
      Returns:
      true if this slot is personal to the player, otherwise false
    • isOffHand

      public boolean isOffHand()
      Get whether this slot is an offhand slot.
      Returns:
      true if this slot is the offhand slot, otherwise false
    • isBody

      public boolean isBody()
      Get whether this slot is a body slot.
      Returns:
      true if this slot is the body slot, otherwise false
    • isSaddle

      public boolean isSaddle()
      Get whether this slot is a saddle slot.
      Returns:
      true if this slot is the saddle slot, otherwise false
    • isCursor

      public boolean isCursor()
      Get whether this slot is the cursor slot. The cursor slot is the slot that hosts the item that the target player is holding in its cursor when they are viewing an inventory themselves.
      Returns:
      true if this slot is the cursor slot, otherwise false
    • defaultIndex

      public int defaultIndex()
      Get the index of the MainSpectatorInventory at which this slot resides.
    • byDefaultIndex

      public static PlayerInventorySlot byDefaultIndex(int index)
      Get the slot given its index in the MainSpectatorInventory.