Package dev.triumphteam.gui.guis
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 actionGuiItem(@NotNull org.bukkit.inventory.ItemStack itemStack, GuiAction<org.bukkit.event.inventory.InventoryClickEvent> action)
Main constructor of the GuiItemGuiItem(@NotNull org.bukkit.Material material)
GuiItem(@NotNull org.bukkit.Material material, @Nullable GuiAction<org.bukkit.event.inventory.InventoryClickEvent> action)
Alternate constructor that takesMaterial
instead of anItemStack
-
Method Summary
Modifier and Type Method Description org.bukkit.inventory.ItemStack
getItemStack()
Gets the GuiItem'sItemStack
void
setAction(GuiAction<org.bukkit.event.inventory.InventoryClickEvent> action)
Replaces theGuiAction
of the current GUI Itemvoid
setItemStack(@NotNull org.bukkit.inventory.ItemStack itemStack)
Replaces theItemStack
of the GUI Item
-
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
- TheItemStack
to be usedaction
- TheGuiAction
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)- Parameters:
material
- TheMaterial
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 takesMaterial
instead of anItemStack
- Parameters:
material
- TheMaterial
to be used when invoking classaction
- TheGuiAction
should be passed onInventoryClickEvent
-
-
Method Details
-
setItemStack
public void setItemStack(@NotNull @NotNull org.bukkit.inventory.ItemStack itemStack)Replaces theItemStack
of the GUI Item- Parameters:
itemStack
- The newItemStack
-
setAction
Replaces theGuiAction
of the current GUI Item- Parameters:
action
- The newGuiAction
to set
-
getItemStack
public org.bukkit.inventory.ItemStack getItemStack()Gets the GuiItem'sItemStack
- Returns:
- The
ItemStack
-