Class InventoryUtils

java.lang.Object
ch.njol.skript.bukkitutil.InventoryUtils

public class InventoryUtils extends Object
Utilities for inventories. In newer versions (1.21+), InventoryView is an interface instead of an abstract class Directing calling InventoryView#getTitle on 1.20.6 and below results in an IncompatibleClassChangeError as an interface, not an abstract class, is expected.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static @Nullable Integer
    convertSlot(org.bukkit.inventory.InventoryView inventoryView, int rawSlot)
     
    static @Nullable org.bukkit.inventory.Inventory
    getBottomInventory(org.bukkit.inventory.InventoryView inventoryView)
     
    static @Nullable org.bukkit.inventory.Inventory
    getInventory(org.bukkit.inventory.InventoryView inventoryView, int rawSlot)
     
    static @Nullable String
    getTitle(org.bukkit.inventory.InventoryView inventoryView)
     
    static @Nullable org.bukkit.inventory.Inventory
    getTopInventory(org.bukkit.inventory.InventoryView inventoryView)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • InventoryUtils

      public InventoryUtils()
  • Method Details

    • getTitle

      public static @Nullable String getTitle(org.bukkit.inventory.InventoryView inventoryView)
      See Also:
      • InventoryView.getTitle()
    • getInventory

      public static @Nullable org.bukkit.inventory.Inventory getInventory(org.bukkit.inventory.InventoryView inventoryView, int rawSlot)
      See Also:
      • InventoryView.getInventory(int)
    • convertSlot

      public static @Nullable Integer convertSlot(org.bukkit.inventory.InventoryView inventoryView, int rawSlot)
      See Also:
      • InventoryView.convertSlot(int)
    • getTopInventory

      public static @Nullable org.bukkit.inventory.Inventory getTopInventory(org.bukkit.inventory.InventoryView inventoryView)
      See Also:
      • InventoryView.getTopInventory()
    • getBottomInventory

      public static @Nullable org.bukkit.inventory.Inventory getBottomInventory(org.bukkit.inventory.InventoryView inventoryView)
      See Also:
      • InventoryView.getBottomInventory()