Interface ClickableGUI

All Superinterfaces:
GUI
All Known Implementing Classes:
ChestGUI

public interface ClickableGUI extends GUI
Extends GUI and adds methods for clickable items
  • Method Details

    • getWidth

      int getWidth()
      Returns the amount of items that fit in a row
      Returns:
      The width of the GUI
    • getHeight

      int getHeight()
      Returns the amount of items that fit in a column
      Returns:
      The width of the GUI
    • getSize

      default int getSize()
      Returns the total amount of items/slots that fit into this GUI
      Returns:
      The size of the GUI
    • setItem

      void setItem(GUIItem item, int slot)
      Set an item at a specific slot
      Parameters:
      item - The item to be set
      slot - The target slot
    • getItem

      @Nullable @Nullable GUIItem getItem(int slot)
      Returns the item at the specific slot. May return null if there's none
      Parameters:
      slot - The slot at which the item may be
      Returns:
      The placed item. May be null
    • fill

      void fill(GUIItem item)
      Replaces any slot with the given item
      Parameters:
      item - The given item
    • fillSpace

      void fillSpace(GUIItem item)
      Replaces any empty/air slot with the given item
      Parameters:
      item - The given item
    • fill

      default void fill(ItemStack is)
      Replaces any slot with the given item
      Parameters:
      is - The given item
    • fill

      default void fill(ItemStack is, ClickListener listener)
      Replaces any slot with the given item and listens for clicks
      Parameters:
      is - The given item
      listener - The click listener
    • fillSpace

      default void fillSpace(ItemStack is)
      Replaces any empty/air slot with the given item
      Parameters:
      is - The given item
    • fillSpace

      default void fillSpace(ItemStack is, ClickListener listener)
      Replaces any empty/air slot with the given item and listens for clicks
      Parameters:
      is - The given item
      listener - The click listener
    • setItem

      default void setItem(GUIItem item, int x, int y)
    • setItem

      default void setItem(ItemStack is, int slot, ClickListener listener)
      Set an item at a specific slot and listen whenever someone clicks on it
      Parameters:
      is - The item to be set
      slot - The target slot
      listener - Listens whenever someone clicks on the item
    • setItem

      default void setItem(ItemStack is, int x, int y, ClickListener listener)
      Set an item at a specific x and y coordinate and listen whenever someone clicks on it
      Parameters:
      is - The item to be set
      x - The target x coordinate
      y - The target y coordinate
      listener - Listens whenever someone clicks on the item
    • setItem

      default void setItem(ItemStack is, int slot)
      Set an item at a specific slot
      Parameters:
      is - The item to be set
      slot - The target slot
    • setItem

      default void setItem(ItemStack is, int x, int y)
      Set an item at a specific x and y coordinate
      Parameters:
      is - The item to be set
      x - The target x coordinate
      y - The target y coordinate
    • getItem

      @Nullable default @Nullable GUIItem getItem(int x, int y)
      Returns the item at the specific x and y slot. May return null if there's none
      Parameters:
      x - The target x coordinate
      y - The target y coordinate
      Returns:
      The placed item. May be null
    • getNextSpace

      int getNextSpace(@Nullable @Nullable AddItemCondition condition)
      Starts at slot 0 and tries to find the next available/empty slot.
      Returns -1 if it didn't find any
      Parameters:
      condition - You may specify the search at a specific area
      Returns:
      The next available/empty slot. -1 if the inventory is full
    • getNextSpace

      default int getNextSpace()
      Starts at slot 0 and tries to find the next available/empty slot.
      Returns -1 if it didn't find any
      Returns:
      The next available/empty slot. -1 if the inventory is full
    • addItem

      default int addItem(GUIItem item, @Nullable @Nullable AddItemCondition condition)
      Adds the item at the next available slot.

      Keep in mind that items with the same materials don't get filled up.

      Parameters:
      item - The item you want to add
      condition - You may specify the search at a specific area
      Returns:
      The slot to which it was added. -1 if the inventory is full
    • addItem

      default int addItem(GUIItem item)
    • addItem

      default int addItem(ItemStack is, ClickListener listener, @Nullable @Nullable AddItemCondition condition)
    • addItem

      default int addItem(ItemStack is, ClickListener listener)
    • addItem

      default int addItem(ItemStack is, @Nullable @Nullable AddItemCondition condition)
    • addItem

      default int addItem(ItemStack is)
    • formatRow

      default void formatRow(int y, CenterFormat format, int min, int max)
    • formatRow

      default void formatRow(int y, CenterFormat format)
    • formatColumn

      default void formatColumn(int x, CenterFormat format, int min, int max)
    • formatColumn

      default void formatColumn(int x, CenterFormat format)
    • formatAnyRow

      default void formatAnyRow(CenterFormat format, int min, int max)
    • formatAnyColumn

      default void formatAnyColumn(CenterFormat format, int min, int max)
    • formatAnyRow

      default void formatAnyRow(CenterFormat format)
    • formatAnyColumn

      default void formatAnyColumn(CenterFormat format)
    • calcSlot

      default int calcSlot(int x, int y)