Class GuiStackManager

java.lang.Object
dev.crafty.core.gui.GuiStackManager

public class GuiStackManager extends Object
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 Details

    • GuiStackManager

      public GuiStackManager()
  • Method Details

    • registerInStack

      public static void registerInStack(org.bukkit.entity.Player player, Menu menu)
      Registers a menu in the player's stack. This should be called when a menu is opened.
      Parameters:
      player - The player viewing the menu
      menu - 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