Class MenuManager
java.lang.Object
me.fami6xx.rpuniverse.core.menuapi.MenuManager
Manages player menus and handles menu-related events.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcloseAllJobMenus(Predicate<Job> predicate)Closes all job menus that match the given predicate.voidcloseAllJobMenus(Predicate<Job> predicate, MenuTag... tags)Closes all job menus that match the given predicate and have the specified tags.voidCloses all menus.voidcloseAllMenusUUIDPredicate(Predicate<UUID> predicate)Closes all menus for players whose UUID matches the given predicate.voidcloseAllMenusUUIDPredicate(Predicate<UUID> predicate, MenuTag... tags)Closes all menus for players whose UUID matches the given predicate and have the specified tags.voidcloseMenu(org.bukkit.entity.Player player)Closes the menu for a given player.booleandisable()Disables the menu manager by unregistering the click handler.booleanenable()Enables the menu manager by registering the click handler.getPlayerMenu(org.bukkit.entity.Player player)Retrieves the PlayerMenu for a given player, creating one if it doesn't exist.voidreopenJobMenus(Predicate<Job> predicate)Reopens job menus for jobs that match the given predicate.voidreopenJobMenus(Predicate<Job> predicate, MenuTag... tags)Reopens job menus for jobs that match the given predicate and have the specified tags.voidreopenMenu(org.bukkit.entity.Player player)Reopens the menu for a given player if it exists.voidreopenMenus(Predicate<org.bukkit.entity.Player> predicate)Reopens menus for players that match the given predicate.
-
Constructor Details
-
MenuManager
public MenuManager()
-
-
Method Details
-
enable
public boolean enable()Enables the menu manager by registering the click handler.- Returns:
- true if the operation was successful.
-
disable
public boolean disable()Disables the menu manager by unregistering the click handler.- Returns:
- true if the operation was successful.
-
getPlayerMenu
Retrieves the PlayerMenu for a given player, creating one if it doesn't exist.- Parameters:
player- the player whose menu is to be retrieved.- Returns:
- the PlayerMenu associated with the player.
-
closeAllJobMenus
Closes all job menus that match the given predicate.- Parameters:
predicate- the predicate to test jobs against.
-
closeAllMenusUUIDPredicate
Closes all menus for players whose UUID matches the given predicate.- Parameters:
predicate- the predicate to test UUIDs against.
-
reopenMenu
public void reopenMenu(org.bukkit.entity.Player player)Reopens the menu for a given player if it exists.- Parameters:
player- the player whose menu is to be reopened.
-
reopenMenus
Reopens menus for players that match the given predicate.- Parameters:
predicate- the predicate to test players against.
-
reopenJobMenus
Reopens job menus for jobs that match the given predicate.- Parameters:
predicate- the predicate to test jobs against.
-
closeAllMenus
public void closeAllMenus()Closes all menus. -
closeMenu
public void closeMenu(org.bukkit.entity.Player player)Closes the menu for a given player.- Parameters:
player- the player whose menu is to be closed.
-