Package net.tnemc.menu.core.manager
Class MenuManager
java.lang.Object
net.tnemc.menu.core.manager.MenuManager
MenuManager class is responsible for managing menus and menu viewers.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a menu to the collection.void
addViewer
(MenuViewer viewer) Adds a MenuViewer to the collection.Finds a menu by its name and returns it as an Optional.findViewer
(UUID id) Finds a MenuViewer by its UUID and returns it as an Optional.net.tnemc.item.platform.registry.BaseHelper
Returns the HelperMethods object associated with this MenuManager.boolean
static MenuManager
instance()
Returns the singleton instance of the MenuManager.void
open
(String menu, int page, MenuPlayer player) void
removeViewer
(UUID identifier) Removes a MenuViewer associated with the given UUID from the viewers map.void
setHelper
(net.tnemc.item.platform.registry.BaseHelper helper) Sets the HelperMethods object associated with this MenuManager.void
updateViewer
(UUID identifier, String menu, int page) Updates the menu and page for a MenuViewer identified by the given UUID.void
updateViewer
(UUID identifier, ViewerStatus status)
-
Field Details
-
ROW_SIZE
public static final int ROW_SIZE- See Also:
-
-
Method Details
-
findMenu
Finds a menu by its name and returns it as an Optional.- Parameters:
name
- The name of the menu to find.- Returns:
- An Optional containing the found menu, or an empty Optional if not found.
-
inMenu
-
findViewer
Finds a MenuViewer by its UUID and returns it as an Optional.- Parameters:
id
- The UUID of the MenuViewer to find.- Returns:
- An Optional containing the found MenuViewer, or an empty Optional if not found.
-
updateViewer
Updates the menu and page for a MenuViewer identified by the given UUID.- Parameters:
identifier
- The UUID identifying the player associated with the MenuViewer.menu
- The new menu to set for the MenuViewer.page
- The new page to set for the MenuViewer.
-
removeViewer
Removes a MenuViewer associated with the given UUID from the viewers map.- Parameters:
identifier
- The UUID identifying the player whoseviewer data
should be removed.
-
recentlyClosed
-
getHelper
public net.tnemc.item.platform.registry.BaseHelper getHelper()Returns the HelperMethods object associated with this MenuManager.- Returns:
- The HelperMethods object associated with this MenuManager.
-
setHelper
public void setHelper(net.tnemc.item.platform.registry.BaseHelper helper) Sets the HelperMethods object associated with this MenuManager.- Parameters:
helper
- The HelperMethods object to be set.
-
instance
Returns the singleton instance of the MenuManager.- Returns:
- The singleton instance of the MenuManager.