Package dev.crafty.core.gui
Class GuiStackManager
java.lang.Object
dev.crafty.core.gui.GuiStackManager
Manages a stack of GUI menus for each player, allowing navigation between menus.
When a player opens a new menu, it's added to their stack.
The back button allows players to navigate to the previous menu in the stack.
If there are no more menus in the stack, the GUI is closed.
- Since:
- 1.0.20
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
handleInventoryClose
(org.bukkit.entity.Player player) Handles when a player closes an inventory without using the back button.static void
markSuppressClose
(org.bukkit.entity.Player player) static void
navigateBack
(org.bukkit.entity.Player player) Navigates back to the previous menu in the stack.static void
registerInStack
(org.bukkit.entity.Player player, Menu menu) Registers a menu in the player's stack.
-
Constructor Details
-
GuiStackManager
public GuiStackManager()
-
-
Method Details
-
registerInStack
Registers a menu in the player's stack. This should be called when a menu is opened.- Parameters:
player
- The player viewing the menumenu
- The menu being opened
-
markSuppressClose
public static void markSuppressClose(org.bukkit.entity.Player player) -
handleInventoryClose
public static void handleInventoryClose(org.bukkit.entity.Player player) Handles when a player closes an inventory without using the back button. This removes the current menu from the stack.- Parameters:
player
- The player who closed the inventory
-