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 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 with Component support
      Parameters:
      rows - The amount of rows the GUI should have
      title - The GUI's title using Component
      interactionModifiers - A set containing the InteractionModifier 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 any InteractionModifier
      Parameters:
      rows - The amount of rows the GUI should have
      title - The GUI's title using Component
      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 using Component
      Since:
      3.0.0
    • StorageGui

      public StorageGui​(@NotNull @NotNull GuiType guiType, @NotNull @NotNull net.kyori.adventure.text.Component title)
      Main constructor that takes a GuiType instead of rows
      Parameters:
      guiType - The GuiType to be used
      title - The GUI's title using Component
      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 a GuiType and a set of InteractionModifier
      Parameters:
      guiType - The GuiType to be used
      title - The GUI's title using Component
      interactionModifiers - A set containing the InteractionModifier 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 have
      title - 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)
      Adds ItemStack to the inventory straight, not the GUI
      Parameters:
      items - Varargs with ItemStacks
      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)
      Adds ItemStack to the inventory straight, not the GUI
      Parameters:
      items - Varargs with ItemStacks
      Returns:
      An immutable Map with the left overs
    • open

      public void open​(@NotNull @NotNull org.bukkit.entity.HumanEntity player)
      Overridden BaseGui.open(HumanEntity) to prevent
      Overrides:
      open in class BaseGui
      Parameters:
      player - The HumanEntity to open the GUI to