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 TypeMethodDescriptionvoidAdds a menu to the collection.voidaddViewer(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.BaseHelperReturns the HelperMethods object associated with this MenuManager.booleanstatic MenuManagerinstance()Returns the singleton instance of the MenuManager.voidopen(String menu, int page, MenuPlayer player) voidremoveViewer(UUID identifier) Removes a MenuViewer associated with the given UUID from the viewers map.voidsetHelper(net.tnemc.item.platform.registry.BaseHelper helper) Sets the HelperMethods object associated with this MenuManager.voidupdateViewer(UUID identifier, String menu, int page) Updates the menu and page for a MenuViewer identified by the given UUID.voidupdateViewer(UUID identifier, ViewerStatus status)
-
Field Details
-
ROW_SIZE
public static final int ROW_SIZE- See Also:
-
-
Method Details
-
instance
Returns the singleton instance of the MenuManager.- Returns:
- The singleton instance of the MenuManager.
-
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 datashould 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.
-