Class GuiManager
java.lang.Object
com.github.darksoulq.abyssallib.world.gui.GuiManager
Central manager for handling the lifecycle and updates of custom GUIs.
This class facilitates opening and closing menus, tracking active views, and running the global tick task that drives GUI animations and logic.
-
Field Summary
FieldsModifier and TypeFieldDescriptionA map of active Bukkit InventoryViews to their corresponding AbyssalLib GuiViews.static final Map<GuiView, ScheduledTask> A map of active BukkitTasks to their corresponding GUiViews. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidclose(org.bukkit.entity.HumanEntity player) Closes the currently open GUI for a player and unregisters its view.static voidOpens a custom GUI for a player.static voidRemoved the GUiView from both Maps so that users may open a new gui over old gui.
-
Field Details
-
OPEN_VIEWS
-
TICK_VIEWS
A map of active BukkitTasks to their corresponding GUiViews.
-
-
Constructor Details
-
GuiManager
public GuiManager()
-
-
Method Details
-
open
Opens a custom GUI for a player.This method validates the player's state (e.g., not sleeping) before creating the inventory and registering the active view.
- Parameters:
player- the player for whom to open the GUIgui- the GUI template to display
-
close
public static void close(org.bukkit.entity.HumanEntity player) Closes the currently open GUI for a player and unregisters its view.- Parameters:
player- the player whose GUI should be closed
-
remove
Removed the GUiView from both Maps so that users may open a new gui over old gui.- Parameters:
view- THe view to remove.
-