Enum Class ViewType

java.lang.Object
java.lang.Enum<ViewType>
me.agent.vgui.api.ViewType
All Implemented Interfaces:
Serializable, Comparable<ViewType>, Constable

public enum ViewType extends Enum<ViewType>
The kind of container window a View renders as.

Each type carries its fixed top-inventory slot count and column width used for row/column math in layouts and fill helpers. The player inventory (36 slots) is always appended after the top inventory by the client.

  • Enum Constant Details

    • CHEST_9X1

      public static final ViewType CHEST_9X1
      Generic chest with 1 row (9 slots).
    • CHEST_9X2

      public static final ViewType CHEST_9X2
      Generic chest with 2 rows (18 slots).
    • CHEST_9X3

      public static final ViewType CHEST_9X3
      Generic chest with 3 rows (27 slots).
    • CHEST_9X4

      public static final ViewType CHEST_9X4
      Generic chest with 4 rows (36 slots).
    • CHEST_9X5

      public static final ViewType CHEST_9X5
      Generic chest with 5 rows (45 slots).
    • CHEST_9X6

      public static final ViewType CHEST_9X6
      Generic chest with 6 rows (54 slots).
    • HOPPER

      public static final ViewType HOPPER
      Hopper window (5 slots in one row).
    • DISPENSER

      public static final ViewType DISPENSER
      3x3 dispenser-style grid (9 slots).
    • ANVIL

      public static final ViewType ANVIL
      Anvil window (3 slots: two inputs, one output). Supports text input via the rename field. See AnvilInputView.
  • Method Details

    • values

      public static ViewType[] 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 ViewType 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
    • slots

      public int slots()
      Number of slots in the top (GUI) inventory.
    • columns

      public int columns()
      Number of columns per row (9 for chests, 5 for hopper, 3 for dispenser/anvil).
    • rows

      public int rows()
      Number of rows (slots() / columns()).
    • isChest

      public boolean isChest()
      True for any of the generic 9xN chest types.
    • chestRows

      public static ViewType chestRows(int rows)
      Chest type for the given row count.
      Parameters:
      rows - rows in [1, 6]
      Returns:
      the matching CHEST_9xN type
      Throws:
      IllegalArgumentException - if rows is out of range
    • chestForSize

      public static ViewType chestForSize(int size)
      Smallest chest type that fits size slots (clamped to [9, 54], rounded up to a full row).