Class GuiItem

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

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

    Constructors
    Constructor
    Description
    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<@NotNull org.bukkit.event.inventory.InventoryClickEvent> action)
    Alternate constructor that takes Material instead of an ItemStack
    GuiItem(@NotNull org.bukkit.inventory.ItemStack itemStack)
    Secondary constructor with no action
    GuiItem(@NotNull org.bukkit.inventory.ItemStack itemStack, @Nullable GuiAction<@NotNull org.bukkit.event.inventory.InventoryClickEvent> action)
    Main constructor of the GuiItem
  • Method Summary

    Modifier and Type
    Method
    Description
    @Nullable GuiAction<org.bukkit.event.inventory.InventoryClickEvent>
    Gets the GuiAction to do when the player clicks on it
    @NotNull org.bukkit.inventory.ItemStack
    Gets the GuiItem's ItemStack
    void
    setAction(@Nullable GuiAction<@NotNull 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

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

    • GuiItem

      public GuiItem(@NotNull @NotNull org.bukkit.inventory.ItemStack itemStack, @Nullable @Nullable GuiAction<@NotNull 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<@NotNull 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

    • getItemStack

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

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

      @Nullable public @Nullable GuiAction<org.bukkit.event.inventory.InventoryClickEvent> getAction()
      Gets the GuiAction to do when the player clicks on it
    • setAction

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