Interface SpigotInventoryUtil


public interface SpigotInventoryUtil
Utility class for Spigot inventory operations
  • Method Summary

    Static Methods
    Modifier and Type
    Method
    Description
    static int
    slotPerRow(org.bukkit.event.inventory.InventoryType inventoryType)
    Get the number of slots per row for the given inventory type
    static Position
    toPosition(int slot, org.bukkit.event.inventory.InventoryType inventoryType)
    Convert a slot index to a position
    static int
    toSlot(Position position, org.bukkit.event.inventory.InventoryType inventoryType)
    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

      static int toSlot(Position position, org.bukkit.event.inventory.InventoryType inventoryType)
      Convert a position to a slot index
      Parameters:
      position - the position
      inventoryType - the inventory type
      Returns:
      the slot index
    • toPosition

      static Position toPosition(int slot, org.bukkit.event.inventory.InventoryType inventoryType)
      Convert a slot index to a position
      Parameters:
      slot - the slot index
      inventoryType - the inventory type
      Returns:
      the position