Class Slot

java.lang.Object
studio.magemonkey.fusion.gui.slot.Slot

public abstract class Slot extends Object
Represent slot properties, multiple inventory slots may use this same instance of slot object as it don't represent some slot, but properties of it.
  • Field Details

    • BASE_CONTAINER_SLOT

      public static final Slot BASE_CONTAINER_SLOT
    • BASE_HOTBAR_SLOT

      public static final Slot BASE_HOTBAR_SLOT
    • BASE_CRAFTING_SLOT

      public static final Slot BASE_CRAFTING_SLOT
    • SPECIAL_CRAFTING_SLOT

      public static final Slot SPECIAL_CRAFTING_SLOT
    • BASE_RESULT_SLOT

      public static final Slot BASE_RESULT_SLOT
    • BLOCKED_SLOT

      public static final Slot BLOCKED_SLOT
    • QUEUED_SLOT

      public static final Slot QUEUED_SLOT
    • BASE_OUTSIDE_SLOT

      public static final Slot BASE_OUTSIDE_SLOT
    • slotType

      protected final org.bukkit.event.inventory.InventoryType.SlotType slotType
      -- GETTER -- Returns base slot type.
  • Constructor Details

    • Slot

      public Slot(org.bukkit.event.inventory.InventoryType.SlotType slotType)
  • Method Details

    • canHoldItem

      public abstract org.bukkit.inventory.ItemStack canHoldItem(org.bukkit.inventory.ItemStack item)
      Method will check if this item can be inserted to this slot-type, it will return this same item stack if it can be inserted or null if it can't be inserted here.
      It may also return other itemstack with this same data but other amount if only part of item can be inserted. (returned itemstack is item stack that can be inserted). Like Beacon block, only one item from item stack can be inserted.

      WARNING: it will not check if there is space in this slot, it only check if this slot can hold this type of item.
      Parameters:
      item - item stack to check.
      Returns:
      item stack that can be inserted here or null.
    • toString

      public String toString()
      Overrides:
      toString in class Object