Class aGUI<T extends Enum<T>>

java.lang.Object
io.github.viimeinen1.ainventory.aGUI<T>

public class aGUI<T extends Enum<T>> extends Object
a GUI that stores multiple inventories.
  • Constructor Details

    • aGUI

      public aGUI(@NotNull @NotNull Class<T> inventoryEnumClass)
      create new GUI.
      Parameters:
      inventoryEnumClass - enum with all possible inventories in the GUI
  • Method Details

    • putInventory

      @NotNull public @NotNull aGUIInventory<T> putInventory(@NotNull @NotNull aGUIInventory<T> inventory)
      Add inventory to the gui.
      Parameters:
      inventory - aGUIInventory
      Returns:
      the inventory that was added.
    • hasInventory

      public boolean hasInventory(@NotNull T inventoryEnum)
      Check if GUI contains inventory.
      Parameters:
      inventoryEnum - Enum value of the inventory.
      Returns:
      true if GUI contains the inventory.
    • openInventory

      public void openInventory(@NotNull T inventoryEnum, @NotNull @NotNull org.bukkit.entity.HumanEntity player) throws NoSuchElementException
      Open inventory for player.
      Parameters:
      inventoryEnum - Enum value of the inventory.
      player - Player who the inventory will be opened to.
      Throws:
      NoSuchElementException - if the inventory has not been set.
    • initializeInventory

      public void initializeInventory(@NotNull T inventoryEnum)
      Re-Run initialization function of the inventory. If the inventory is not set, will fail silently.
      Parameters:
      inventoryEnum - Enum value of the inventory.
    • reloadInventory

      public void reloadInventory(@NotNull T inventoryEnum)
      Run reload function of the inventory. If the inventory is not set, will fail silently.
      Parameters:
      inventoryEnum - Enum value of the inventory.