Class MenuManager

java.lang.Object
me.fami6xx.rpuniverse.core.menuapi.MenuManager

public class MenuManager extends Object
Manages player menus and handles menu-related events.
  • 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

      public PlayerMenu getPlayerMenu(org.bukkit.entity.Player player)
      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

      public void closeAllJobMenus(Predicate<Job> predicate)
      Closes all job menus that match the given predicate.
      Parameters:
      predicate - the predicate to test jobs against.
    • closeAllMenusUUIDPredicate

      public void closeAllMenusUUIDPredicate(Predicate<UUID> predicate)
      Closes all menus for players whose UUID matches the given predicate.
      Parameters:
      predicate - the predicate to test UUIDs against.
    • closeAllMenusUUIDPredicate

      public void closeAllMenusUUIDPredicate(Predicate<UUID> predicate, MenuTag... tags)
      Closes all menus for players whose UUID matches the given predicate and have the specified tags.
      Parameters:
      predicate - the predicate to test UUIDs against.
      tags - the tags to check for.
    • 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

      public void reopenMenus(Predicate<org.bukkit.entity.Player> predicate)
      Reopens menus for players that match the given predicate.
      Parameters:
      predicate - the predicate to test players against.
    • reopenJobMenus

      public void reopenJobMenus(Predicate<Job> predicate)
      Reopens job menus for jobs that match the given predicate.
      Parameters:
      predicate - the predicate to test jobs against.
    • reopenJobMenus

      public void reopenJobMenus(Predicate<Job> predicate, MenuTag... tags)
      Reopens job menus for jobs that match the given predicate and have the specified tags.
      Parameters:
      predicate - the predicate to test jobs against.
      tags - the tags to check for.
    • closeAllJobMenus

      public void closeAllJobMenus(Predicate<Job> predicate, MenuTag... tags)
      Closes all job menus that match the given predicate and have the specified tags.
      Parameters:
      predicate - the predicate to test jobs against.
      tags - the tags to check for.
    • 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.