Class BaseIOGUIPane<S extends BaseIOGUIPane<S>>

Type Parameters:
S - The implementing class to return this-type correctly e.g. BaseSimpleGUIPane.addItemEmptySlot(GUIItem)
All Implemented Interfaces:
Sizeable
Direct Known Subclasses:
IOGUIPane, SynchedGUIPane

public class BaseIOGUIPane<S extends BaseIOGUIPane<S>> extends BaseSimpleItemGUIPane<S>
GUIPane which allows Items to be inserted and taken out
  • Constructor Details

    • BaseIOGUIPane

      protected BaseIOGUIPane(GUI gui, Vector2d minSize, Vector2d maxSize, boolean autoSize, boolean input, boolean output, boolean removeItemsOnInventoryClose, IOConsumer onItemChange)
      Creates a new TransferGUIPane
      Parameters:
      gui - The GUI
      minSize - The minimum size of the Pane
      maxSize - The maximum size of the Pane
      autoSize - Whether to automatically resize the pane according to the children. If true it will set the size to the bounding box of all children.
      input - Whether it should be allowed to input items into the IO-Pane.
      output - Whether it should be allowed to remove items from the IO-Pane.
      removeItemsOnInventoryClose - Whether to give the items back to the player it the player closes the inventory
      onItemChange - Executed when an item in the pane changes
  • Method Details

    • onItemAdd

      public boolean onItemAdd(Vector2d position, org.bukkit.inventory.ItemStack itemStack)
      Description copied from class: GUISection
      Called when an item is added to an empty slot
      Overrides:
      onItemAdd in class GUIPane
      Parameters:
      position - The relative position of the slot
      itemStack - The itemstack that was added
      Returns:
      Whether this action should be cancelled.
    • onItemRemove

      public org.bukkit.inventory.ItemStack onItemRemove(Vector2d position)
      Description copied from class: GUISection
      Called when an item is removed from an empty slot
      Overrides:
      onItemRemove in class GUIPane
      Parameters:
      position - The relative position of the slot
      Returns:
      The removed Item, if any
    • onItemRemoveTroughInventoryClose

      public org.bukkit.inventory.ItemStack onItemRemoveTroughInventoryClose(Vector2d position)
      Description copied from class: GUISection
      Called when the inventory is closed and the item could be added to the players inventory
      Overrides:
      onItemRemoveTroughInventoryClose in class GUIPane
      Parameters:
      position - The relative position of the slot
      Returns:
      The removed Item, if any
    • onItemAmount

      public boolean onItemAmount(Vector2d position, int amount)
      Description copied from class: GUISection
      Called when the amount of an item in a slot changes
      Overrides:
      onItemAmount in class GUIPane
      Parameters:
      position - The relative position of the slot
      amount - The new amount of the item
      Returns:
      Whether this action should be cancelled.
    • onItemProvide

      public void onItemProvide(org.bukkit.inventory.ItemStack itemStack)
      Description copied from class: GUIPane
      Called when an item is provided by an inventory MOVE_TO_OTHER_INVENTORY event
      Overrides:
      onItemProvide in class BaseSimpleGUIPane<GUIItem,S extends BaseIOGUIPane<S>>
      Parameters:
      itemStack - The provided item. Method reduces the amount of the item by the number that got accepted.
    • onItemChange

      public void onItemChange(Vector2d position, org.bukkit.inventory.ItemStack itemStack)
      Called when an item changes
      Parameters:
      position - The position of the item that changed
      itemStack - The new ItemStack