Class Menus

java.lang.Object
ua.mcchickenstudio.opencreative.menus.Menus
All Implemented Interfaces:
org.bukkit.event.Listener

public final class Menus extends Object implements org.bukkit.event.Listener

Menus

This class represents a menu manager, that stores current opened menus for handling inventory open, click and close events.

To make InventoryMenu usable for handling inventory events, register this menus with addMenu(InventoryMenu) method. To avoid memory leaks, please unregister it on inventory close event with removeMenu(InventoryMenu)

  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    Registers menus in menus manager for handling inventory events.
    static void
    onBlockDestroy(org.bukkit.Location location)
     
    void
    onClick(org.bukkit.event.inventory.InventoryClickEvent event)
     
    void
    onClose(org.bukkit.event.inventory.InventoryCloseEvent event)
     
    void
    onOpen(org.bukkit.event.inventory.InventoryOpenEvent event)
     
    static void
    Unregisters menus from menus event listeners, required if menus is not more useful because player closed it.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Menus

      public Menus()
  • Method Details

    • onBlockDestroy

      public static void onBlockDestroy(org.bukkit.Location location)
    • addMenu

      public static void addMenu(InventoryMenu menu)
      Registers menus in menus manager for handling inventory events.
      Parameters:
      menu - menus to add.
    • removeMenu

      public static void removeMenu(InventoryMenu menu)
      Unregisters menus from menus event listeners, required if menus is not more useful because player closed it.
      Parameters:
      menu - menus to remove.
    • onClick

      public void onClick(org.bukkit.event.inventory.InventoryClickEvent event)
    • onOpen

      public void onOpen(org.bukkit.event.inventory.InventoryOpenEvent event)
    • onClose

      public void onClose(org.bukkit.event.inventory.InventoryCloseEvent event)