Package de.clickism.clickgui.menu
Class MenuManager
java.lang.Object
de.clickism.clickgui.menu.MenuManager
- All Implemented Interfaces:
org.bukkit.event.Listener
Listens for menu clicks and passes them to their active menus.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionMenuManager(org.bukkit.plugin.java.JavaPlugin plugin) Creates a new menu manager and registers it as a listener. -
Method Summary
Modifier and TypeMethodDescriptionvoidCloses all active menus.static MenuManagerGets the instance of the menu manager, or null if no instance was set.voidonClick(org.bukkit.event.inventory.InventoryClickEvent event) Passes the click event to the active menu.voidonClose(org.bukkit.event.inventory.InventoryCloseEvent event) Closes the active menu when the inventory is closed.voidonDisable(org.bukkit.event.server.PluginDisableEvent event) Closes all active menus when the plugin is disabled.voidonDrag(org.bukkit.event.inventory.InventoryDragEvent event) Passes the drag event to the active menu.Opens a menu.registerActiveView(MenuView view) Registers a menu view.static voidsetInstance(MenuManager instance) Sets the instance of the menu manager to be used by the shorthand methodMenu.open().
-
Field Details
-
instance
The instance of the menu manager.
-
-
Constructor Details
-
MenuManager
public MenuManager(org.bukkit.plugin.java.JavaPlugin plugin) Creates a new menu manager and registers it as a listener.- Parameters:
plugin- the plugin to register the listener with
-
-
Method Details
-
closeActiveMenus
public void closeActiveMenus()Closes all active menus. -
onDisable
public void onDisable(org.bukkit.event.server.PluginDisableEvent event) Closes all active menus when the plugin is disabled.- Parameters:
event- the event
-
onClick
public void onClick(org.bukkit.event.inventory.InventoryClickEvent event) Passes the click event to the active menu.- Parameters:
event- the event
-
onDrag
public void onDrag(org.bukkit.event.inventory.InventoryDragEvent event) Passes the drag event to the active menu.- Parameters:
event- the event
-
onClose
public void onClose(org.bukkit.event.inventory.InventoryCloseEvent event) Closes the active menu when the inventory is closed.- Parameters:
event- the event
-
getInstance
Gets the instance of the menu manager, or null if no instance was set.- Returns:
- the instance