Package me.despical.inventoryframework
Class GuiItem
java.lang.Object
me.despical.inventoryframework.GuiItem
An item for in an inventory
- Since:
- 1.0.1
Created at 04.09.2020
- Author:
- Despical
-
Constructor Summary
ConstructorsConstructorDescriptionGuiItem(@NotNull org.bukkit.inventory.ItemStack item) Creates a new gui item based on the item stack and actionGuiItem(@NotNull org.bukkit.inventory.ItemStack item, @Nullable Consumer<org.bukkit.event.inventory.InventoryClickEvent> action) Creates a new gui item based on the item stack and action -
Method Summary
Modifier and TypeMethodDescription@NotNull Consumer<org.bukkit.event.inventory.InventoryClickEvent> Returns the action for this item@NotNull org.bukkit.inventory.ItemStackgetItem()Returns the item@NotNull UUIDgetUUID()booleanReturns whether or not this item is visiblestatic GuiItemof(@NotNull org.bukkit.inventory.ItemStack itemStack) static GuiItemof(@NotNull org.bukkit.inventory.ItemStack itemStack, @Nullable Consumer<org.bukkit.event.inventory.InventoryClickEvent> action) voidsetVisible(boolean visible) Sets the visibility of this item to the new visibility
-
Constructor Details
-
GuiItem
public GuiItem(@NotNull @NotNull org.bukkit.inventory.ItemStack item, @Nullable @Nullable Consumer<org.bukkit.event.inventory.InventoryClickEvent> action) Creates a new gui item based on the item stack and action- Parameters:
item- the item stackaction- the action called whenever an interaction with this item happens
-
GuiItem
public GuiItem(@NotNull @NotNull org.bukkit.inventory.ItemStack item) Creates a new gui item based on the item stack and action- Parameters:
item- the item stack
-
-
Method Details
-
of
-
of
-
getAction
@NotNull @Contract(pure=true) public @NotNull Consumer<org.bukkit.event.inventory.InventoryClickEvent> getAction()Returns the action for this item- Returns:
- the action called when clicked on this item
-
getItem
@NotNull @Contract(pure=true) public @NotNull org.bukkit.inventory.ItemStack getItem()Returns the item- Returns:
- the item that belongs to this gui item
-
getUUID
- Returns:
- the
UUIDof this item - Since:
- 1.0.1
-
isVisible
public boolean isVisible()Returns whether or not this item is visible- Returns:
- true if this item is visible, false otherwise
-
setVisible
public void setVisible(boolean visible) Sets the visibility of this item to the new visibility- Parameters:
visible- the new visibility
-