Interface SpigotInventoryUtil
public interface SpigotInventoryUtil
Utility class for Spigot inventory operations
-
Method Summary
Static MethodsModifier and TypeMethodDescriptionstatic int
slotPerRow
(org.bukkit.event.inventory.InventoryType inventoryType) Get the number of slots per row for the given inventory typestatic Position
toPosition
(int slot, org.bukkit.event.inventory.InventoryType inventoryType) Convert a slot index to a positionstatic int
Convert a position to a slot index
-
Method Details
-
slotPerRow
static int slotPerRow(org.bukkit.event.inventory.InventoryType inventoryType) Get the number of slots per row for the given inventory type- Parameters:
inventoryType
- the inventory type- Returns:
- the number of slots per row, or 0 if not applicable (e.g., non-grid inventories)
-
toSlot
Convert a position to a slot index- Parameters:
position
- the positioninventoryType
- the inventory type- Returns:
- the slot index
-
toPosition
Convert a slot index to a position- Parameters:
slot
- the slot indexinventoryType
- the inventory type- Returns:
- the position
-