Package dev.triumphteam.gui.guis
Class StorageGui
java.lang.Object
dev.triumphteam.gui.guis.BaseGui
dev.triumphteam.gui.guis.StorageGui
- All Implemented Interfaces:
org.bukkit.inventory.InventoryHolder
public class StorageGui extends BaseGui
GUI that does not clear it's items once it's closed
-
Constructor Summary
Constructors Constructor Description StorageGui(int rows, @NotNull java.lang.String title)
Deprecated.StorageGui(int rows, @NotNull net.kyori.adventure.text.Component title)
Alternative constructor to provide a way to create GUIs that don't need anyInteractionModifier
StorageGui(int rows, @NotNull net.kyori.adventure.text.Component title, @NotNull java.util.Set<InteractionModifier> interactionModifiers)
Main constructor for the StorageGui, now withComponent
supportStorageGui(@NotNull GuiType guiType, @NotNull net.kyori.adventure.text.Component title)
Main constructor that takes aGuiType
instead of rowsStorageGui(@NotNull GuiType guiType, @NotNull net.kyori.adventure.text.Component title, @NotNull java.util.Set<InteractionModifier> interactionModifiers)
Alternative constructor that takes both aGuiType
and a set ofInteractionModifier
StorageGui(@NotNull java.lang.String title)
Deprecated.StorageGui(@NotNull net.kyori.adventure.text.Component title)
Alternative constructor that defaults to 1 row -
Method Summary
Modifier and Type Method Description java.util.Map<java.lang.Integer,org.bukkit.inventory.ItemStack>
addItem(@NotNull java.util.List<org.bukkit.inventory.ItemStack> items)
AddsItemStack
to the inventory straight, not the GUIjava.util.Map<java.lang.Integer,org.bukkit.inventory.ItemStack>
addItem(@NotNull org.bukkit.inventory.ItemStack... items)
AddsItemStack
to the inventory straight, not the GUIvoid
open(@NotNull org.bukkit.entity.HumanEntity player)
OverriddenBaseGui.open(HumanEntity)
to preventMethods inherited from class dev.triumphteam.gui.guis.BaseGui
addItem, addSlotAction, addSlotAction, canPlaceItems, canSwapItems, canTakeItems, close, close, disableAllInteractions, disableItemPlace, disableItemSwap, disableItemTake, enableAllInteractions, enableItemPlace, enableItemSwap, enableItemTake, getFiller, getGuiItem, getGuiItems, getInventory, getRows, guiType, isUpdating, removeItem, removeItem, setCloseGuiAction, setDefaultClickAction, setDefaultTopClickAction, setDragAction, setInventory, setItem, setItem, setItem, setOpenGuiAction, setOutsideClickAction, setPlayerInventoryAction, setUpdating, update, updateItem, updateItem, updateItem, updateItem, updateTitle, updateTitle
-
Constructor Details
-
StorageGui
public StorageGui(int rows, @NotNull @NotNull net.kyori.adventure.text.Component title, @NotNull @NotNull java.util.Set<InteractionModifier> interactionModifiers)Main constructor for the StorageGui, now withComponent
support- Parameters:
rows
- The amount of rows the GUI should havetitle
- The GUI's title usingComponent
interactionModifiers
- A set containing theInteractionModifier
this GUI should use- Since:
- 3.0.0
-
StorageGui
public StorageGui(int rows, @NotNull @NotNull net.kyori.adventure.text.Component title)Alternative constructor to provide a way to create GUIs that don't need anyInteractionModifier
- Parameters:
rows
- The amount of rows the GUI should havetitle
- The GUI's title usingComponent
- Since:
- 3.0.0
-
StorageGui
public StorageGui(@NotNull @NotNull net.kyori.adventure.text.Component title)Alternative constructor that defaults to 1 row- Parameters:
title
- The GUI's title usingComponent
- Since:
- 3.0.0
-
StorageGui
public StorageGui(@NotNull @NotNull GuiType guiType, @NotNull @NotNull net.kyori.adventure.text.Component title)Main constructor that takes aGuiType
instead of rows- Parameters:
guiType
- TheGuiType
to be usedtitle
- The GUI's title usingComponent
- Since:
- 3.0.0
-
StorageGui
public StorageGui(@NotNull @NotNull GuiType guiType, @NotNull @NotNull net.kyori.adventure.text.Component title, @NotNull @NotNull java.util.Set<InteractionModifier> interactionModifiers)Alternative constructor that takes both aGuiType
and a set ofInteractionModifier
- Parameters:
guiType
- TheGuiType
to be usedtitle
- The GUI's title usingComponent
interactionModifiers
- A set containing theInteractionModifier
this GUI should use- Since:
- 3.0.0
-
StorageGui
@Deprecated public StorageGui(int rows, @NotNull @NotNull java.lang.String title)Deprecated.Main constructor of the Persistent GUI- Parameters:
rows
- The rows the GUI should havetitle
- The GUI's title
-
StorageGui
@Deprecated public StorageGui(@NotNull @NotNull java.lang.String title)Deprecated.Alternative constructor that does not require rows- Parameters:
title
- The GUI's title
-
-
Method Details
-
addItem
public java.util.Map<java.lang.Integer,org.bukkit.inventory.ItemStack> addItem(@NotNull @NotNull org.bukkit.inventory.ItemStack... items)AddsItemStack
to the inventory straight, not the GUI- Parameters:
items
- Varargs withItemStack
s- Returns:
- An immutable
Map
with the left overs
-
addItem
public java.util.Map<java.lang.Integer,org.bukkit.inventory.ItemStack> addItem(@NotNull @NotNull java.util.List<org.bukkit.inventory.ItemStack> items)AddsItemStack
to the inventory straight, not the GUI- Parameters:
items
- Varargs withItemStack
s- Returns:
- An immutable
Map
with the left overs
-
open
public void open(@NotNull @NotNull org.bukkit.entity.HumanEntity player)OverriddenBaseGui.open(HumanEntity)
to prevent
-