Klasse MenuManager

java.lang.Object
de.delinkedde.mobarenareborn.gui.MenuManager
Alle implementierten Schnittstellen:
Listener

public final class MenuManager extends Object implements Listener
Opens Menus and routes their inventory events.

While a menu is open all clicks in it are cancelled so the player cannot remove items; clicks on the menu's own slots are dispatched to the menu's actions. The open menu is forgotten on close.

  • Konstruktordetails

    • MenuManager

      public MenuManager()
  • Methodendetails

    • open

      public void open(@NotNull @NotNull Player player, @NotNull @NotNull Menu menu)
      Opens a menu for a player.
      Parameter:
      player - the player
      menu - the menu to open
    • onClick

      public void onClick(@NotNull @NotNull InventoryClickEvent event)
      Cancels and dispatches clicks within an open menu.
      Parameter:
      event - the click event
    • onDrag

      public void onDrag(@NotNull @NotNull InventoryDragEvent event)
      Cancels drag operations while a menu is open, so items cannot be dragged into (and lost in) the menu inventory.
      Parameter:
      event - the drag event
    • onClose

      public void onClose(@NotNull @NotNull InventoryCloseEvent event)
      Forgets a player's menu when it closes.
      Parameter:
      event - the close event