Class ItemSource<T>

java.lang.Object
ch.njol.skript.util.ItemSource<T>

public class ItemSource<T> extends Object
Container class for containing the origin of a Slot, ItemStack, and ItemType.
  • Constructor Details

    • ItemSource

      public ItemSource(T source)
  • Method Details

    • fromSlot

      @Nullable public static @Nullable ItemSource<Slot> fromSlot(Slot slot)
      Checks if the ItemStack in slot is a valid item.
      Parameters:
      slot - The Slot to check.
      Returns:
      ItemSource if the item is valid, otherwise null.
    • getSource

      public T getSource()
      Get the source object, can be a Slot, ItemStack, or ItemType.
    • getItemStack

      public org.bukkit.inventory.ItemStack getItemStack()
      Get the ItemStack retrieved from source.
    • getItemMeta

      public org.bukkit.inventory.meta.ItemMeta getItemMeta()
      Get the ItemMeta retrieved from source.
    • setItemMeta

      public void setItemMeta(org.bukkit.inventory.meta.ItemMeta itemMeta)
      Appropriately update the ItemMeta of source.
      Parameters:
      itemMeta - The ItemMeta to update source