Class GuiItem

java.lang.Object
dev.triumphteam.gui.guis.GuiItem

public class GuiItem
extends java.lang.Object
GuiItem represents the ItemStack on the Inventory
  • Constructor Summary

    Constructors 
    Constructor Description
    GuiItem​(@NotNull org.bukkit.inventory.ItemStack itemStack)
    Secondary constructor with no action
    GuiItem​(@NotNull org.bukkit.inventory.ItemStack itemStack, GuiAction<org.bukkit.event.inventory.InventoryClickEvent> action)
    Main constructor of the GuiItem
    GuiItem​(@NotNull org.bukkit.Material material)
    Alternate constructor that takes Material instead of an ItemStack but without a GuiAction
    GuiItem​(@NotNull org.bukkit.Material material, @Nullable GuiAction<org.bukkit.event.inventory.InventoryClickEvent> action)
    Alternate constructor that takes Material instead of an ItemStack
  • Method Summary

    Modifier and Type Method Description
    org.bukkit.inventory.ItemStack getItemStack()
    Gets the GuiItem's ItemStack
    void setAction​(GuiAction<org.bukkit.event.inventory.InventoryClickEvent> action)
    Replaces the GuiAction of the current GUI Item
    void setItemStack​(@NotNull org.bukkit.inventory.ItemStack itemStack)
    Replaces the ItemStack of the GUI Item

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • GuiItem

      public GuiItem​(@NotNull @NotNull org.bukkit.inventory.ItemStack itemStack, GuiAction<org.bukkit.event.inventory.InventoryClickEvent> action)
      Main constructor of the GuiItem
      Parameters:
      itemStack - The ItemStack to be used
      action - The GuiAction to run when clicking on the Item
    • GuiItem

      public GuiItem​(@NotNull @NotNull org.bukkit.inventory.ItemStack itemStack)
      Secondary constructor with no action
      Parameters:
      itemStack - The ItemStack to be used
    • GuiItem

      public GuiItem​(@NotNull @NotNull org.bukkit.Material material)
      Alternate constructor that takes Material instead of an ItemStack but without a GuiAction
      Parameters:
      material - The Material to be used when invoking class
    • GuiItem

      public GuiItem​(@NotNull @NotNull org.bukkit.Material material, @Nullable @Nullable GuiAction<org.bukkit.event.inventory.InventoryClickEvent> action)
      Alternate constructor that takes Material instead of an ItemStack
      Parameters:
      material - The Material to be used when invoking class
      action - The GuiAction should be passed on InventoryClickEvent
  • Method Details

    • setItemStack

      public void setItemStack​(@NotNull @NotNull org.bukkit.inventory.ItemStack itemStack)
      Replaces the ItemStack of the GUI Item
      Parameters:
      itemStack - The new ItemStack
    • setAction

      public void setAction​(GuiAction<org.bukkit.event.inventory.InventoryClickEvent> action)
      Replaces the GuiAction of the current GUI Item
      Parameters:
      action - The new GuiAction to set
    • getItemStack

      public org.bukkit.inventory.ItemStack getItemStack()
      Gets the GuiItem's ItemStack
      Returns:
      The ItemStack