Class GuiItem

java.lang.Object
Kyu.GuiAPI_Redone.Item.GuiItem

public class GuiItem extends Object
  • Constructor Details

    • GuiItem

      public GuiItem(org.bukkit.inventory.ItemStack stack)
      Creates a new Item with the specified ItemStack
      Parameters:
      stack -
    • GuiItem

      public GuiItem(org.bukkit.inventory.ItemStack stack, String title, String... lore)
      Creates a new Item with the specified Values
      Parameters:
      stack - ItemStack of the Item
      title - Name of the Item (will be color translated)
      lore - Lore of the item (if wanted), each string is a new line
    • GuiItem

      public GuiItem(org.bukkit.Material material, String name, int amountInStack, String... lore)
      Creates a new Item with the specified Values
      Parameters:
      material - Material of the Item
      name - Name of the Item (will be color translated)
      amountInStack - Size of the ItemStack
      lore - Lore of the item (if wanted), each string is a new line
  • Method Details

    • withListener

      public GuiItem withListener(GuiItemClickListener listener)
      Parameters:
      listener - What to be called when the item gets clicked in the inventory
      Returns:
      the item again for continued building
    • setListener

      public void setListener(GuiItemClickListener listener)
      Manually set the Listener for when the item is clicked
      Parameters:
      listener - What to be called when the item gets clicked in the inventory
    • setItemStack

      public void setItemStack(org.bukkit.inventory.ItemStack itemStack)
      Sets a new ItemStack and updates all Windows with the item
      Parameters:
      itemStack - the new ItemStack
    • setLore

      public void setLore(String... lore)
      Sets the lore of the Item and updates all Windows with the item
      Parameters:
      lore - the new lore, each string is a new line (will be color translated)
    • setName

      public void setName(String name)
      Change the name of the itemstack
      Parameters:
      name -
    • getListener

      public GuiItemClickListener getListener()
      Returns:
      Listener for when the item gets clicked in the inventory
    • getItemStack

      public org.bukkit.inventory.ItemStack getItemStack()
      Returns:
      the itemstack of the item
    • addWindow

      public void addWindow(Window window)
      Add the link between item and window, that causes the item to refresh this window if changes are made to the item
      Parameters:
      window -
    • removeWindow

      public void removeWindow(Window window)
      Remove the link between item and window, that causes the item not the refresh in the specified window if changes are made
      Parameters:
      window -