Class Grid
java.lang.Object
com.ultikits.ultitools.ui.Grid
An item-centred screen addressed by slot: a snapshot of what each slot shows and what a click does.
Each slot is empty, an icon (
GridItem: shown, never takeable) or a binding to a SlotContainer
index (bindings(); EDITABLE or VIEW). Never completes with a value; it ends with
UiResult.Closed. Refresh by pushing a new snapshot through GridSession.update(Grid).
Before opening from the player's own backpack, nonempty cursor or crafting inputs are returned by
vanilla menu cleanup to the backpack (overflow drops at the player's feet), never carried into the grid.
Empty backpacks and foreign containers do not receive an extra framework close.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classA reusable, non-thread-safe snapshot builder. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionThe binding at a slot, if any.bindings()Bound slots; unmodifiable; disjoint fromitems().static Grid.BuilderbooleaninthashCode()The icon at a slot, if any.items()Icon slots; unmodifiable.introws()The number of visible rows.title()Title shown by every backend.toString()
-
Field Details
-
COLUMNS
public static final int COLUMNSThe fixed number of columns.- See Also:
-
title
-
rows
private final int rows -
items
-
bindings
-
-
Constructor Details
-
Grid
-
-
Method Details
-
builder
- Throws:
IllegalArgumentException- ifrowsis outside 1..6
-
title
-
rows
public int rows()The number of visible rows. -
items
Icon slots; unmodifiable. A slot with neither an icon nor a binding (bindings()) is empty. -
item
-
bindings
Bound slots; unmodifiable; disjoint fromitems(). -
binding
The binding at a slot, if any. -
equals
-
hashCode
-
toString
-