-
Method Summary
Deep copies this
MenuSize
into an identical object clone.
int
int
Returns the slot number for the slot in the last row with the given index in that row.
int
Maps a position to a slot number.
-
Method Details
-
-
getSlotInLastRow
int getSlotInLastRow(int index)
Returns the slot number for the slot in the last row with the given index in that row.
-
copy
Deep copies this
MenuSize
into an identical object clone.
-
getNumberOfSlots
int getNumberOfSlots()
- Returns:
- the 1-index number of slots in this menu size.
-
mapPositionToSlot
Maps a position to a slot number. For example position (1, 1) maps to slot 0 (top-left) in a traditional inventory.
- Parameters:
row
- The row (top to bottom) of the position. (1-indexed)
col
- The column (left to right) of the position. (1-indexed)
- Returns:
- The bukkit slot number corresponding to the given position.
- Throws:
IllegalArgumentException
- if the given position is outside the bounds of this MenuSize.
IllegalStateException
- if this method is called on an unsupported MenuSize (including some MenuSizeType
s using non-standard InventoryType
configurations.)