java.lang.Object
de.placeblock.betterinventories.content.GUISection
de.placeblock.betterinventories.content.item.GUIItem
All Implemented Interfaces:
Sizeable
Direct Known Subclasses:
GUIButton

public class GUIItem extends GUISection
A GUISection with a size of 1x1 containing an ItemStack
  • Field Details

    • BUTTON_SIZE

      public static final Vector2d BUTTON_SIZE
      The Size of every GUIItem
    • itemStack

      protected org.bukkit.inventory.ItemStack itemStack
      The ItemStack to be rendered
  • Constructor Details

    • GUIItem

      public GUIItem(GUI gui, org.bukkit.inventory.ItemStack itemStack)
      Creates a new GUIItem
      Parameters:
      gui - The GUI
      itemStack - The ItemStack. ItemBuilder may help to create it.
  • Method Details

    • render

      public List<org.bukkit.inventory.ItemStack> render()
      Renders the GUIItem on a list
      Specified by:
      render in class GUISection
      Returns:
      The List
    • search

      public void search(SearchData searchData)
      Searches the GUISection recursively. The SearchData is filled recursively.
      Specified by:
      search in class GUISection
      Parameters:
      searchData - The searchData that contains all needed information
    • onItemClick

      public void onItemClick(ClickData data)
      Description copied from class: GUISection
      Called when a user clicks on an item. Usually after this method one of the add/remove/amount methods is called.
      Specified by:
      onItemClick in class GUISection
      Parameters:
      data - The clickdata
    • 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
      Specified by:
      onItemAdd in class GUISection
      Parameters:
      position - The relative position of the slot
      itemStack - The itemstack that was added
      Returns:
      Whether this action is allowed.
    • onItemRemove

      public org.bukkit.inventory.ItemStack onItemRemove(Vector2d position)
      Description copied from class: GUISection
      Called when an item is removed from an empty slot
      Specified by:
      onItemRemove in class GUISection
      Parameters:
      position - The relative position of the slot
      Returns:
      Whether this action is allowed.
    • onItemAmount

      public boolean onItemAmount(Vector2d position, int amount)
      Description copied from class: GUISection
      Called when the amount of an item in a slot changes
      Specified by:
      onItemAmount in class GUISection
      Parameters:
      position - The relative position of the slot
      amount - The new amount of the item
      Returns:
      Whether this action is allowed.