Package io.github.viimeinen1.ainventory
Class aGUI<T extends Enum<T>>
java.lang.Object
io.github.viimeinen1.ainventory.aGUI<T>
a GUI that stores multiple inventories.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanhasInventory(T inventoryEnum) Check if GUI contains inventory.voidinitializeInventory(T inventoryEnum) Re-Run initialization function of the inventory.voidopenInventory(T inventoryEnum, @NotNull org.bukkit.entity.HumanEntity player) Open inventory for player.@NotNull aGUIInventory<T> putInventory(@NotNull aGUIInventory<T> inventory) Add inventory to the gui.voidreloadInventory(T inventoryEnum) Run reload function of the inventory.
-
Constructor Details
-
aGUI
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
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
Re-Run initialization function of the inventory. If the inventory is not set, will fail silently.- Parameters:
inventoryEnum- Enum value of the inventory.
-
reloadInventory
Run reload function of the inventory. If the inventory is not set, will fail silently.- Parameters:
inventoryEnum- Enum value of the inventory.
-