Enum Class EquipmentSlot

java.lang.Object
java.lang.Enum<EquipmentSlot>
com.valhalla.sdk.api.equipment.EquipmentSlot
All Implemented Interfaces:
Serializable, Comparable<EquipmentSlot>, Constable

public enum EquipmentSlot extends Enum<EquipmentSlot>
The eleven worn-item slots in mobile equipment-panel order.

Two different slot numbers exist and they are not interchangeable. Panel order is the dense 0-10 index the native slot-action hook accepts. Container slot is the game's own worn-item numbering, which skips 6, 8, and 11, and is what every Item.getSlot() in an equipment snapshot actually carries.

They agree for the first six slots and diverge from the legs down, so reading a snapshot with a panel index silently returns the wrong armour: HANDS (panel 7) would match the item worn on the legs (container 7). Always match snapshots on getContainerSlot().

  • Enum Constant Details

  • Method Details

    • values

      public static EquipmentSlot[] 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 EquipmentSlot 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
    • getSlot

      public int getSlot()
      Returns the dense equipment-panel index used by native slot actions.
      Returns:
      panel index from 0 through 10
    • getContainerSlot

      public int getContainerSlot()
      Returns the game's worn-item container slot, as carried by every item in an equipment snapshot. Skips 6, 8, and 11.
      Returns:
      container slot from 0 through 13
    • forSlot

      public static EquipmentSlot forSlot(int slot)
      Resolves an equipment-panel index.
      Parameters:
      slot - panel index
      Returns:
      matching equipment slot, or null when outside 0 through 10
    • forContainerSlot

      public static EquipmentSlot forContainerSlot(int containerSlot)
      Resolves a worn-item container slot, the value snapshots carry.
      Parameters:
      containerSlot - container slot
      Returns:
      matching equipment slot, or null when it is not a worn slot