Interface MenuManager


public interface MenuManager
An interface used to interact with menus, including building, opening, and extending menus.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    buildMenu(String name, Consumer<dev.aurelium.slate.builder.MenuBuilder> menu)
    Provides access to a MenuBuilder for building a Slate menu.
    void
    openLevelProgressionMenu(org.bukkit.entity.Player player, Skill skill)
    Opens the AuraSkills level progression menu for a player.
    void
    openMenu(org.bukkit.entity.Player player, String name)
    Opens a menu for a player with the given name.
    void
    openMenu(org.bukkit.entity.Player player, String name, Map<String,Object> properties)
    Opens a menu for a player with the given name and properties.
    void
    openMenu(org.bukkit.entity.Player player, String name, Map<String,Object> properties, int page)
    Opens a menu for a player with the given name, properties, and page.
    <T> void
    registerContext(String key, Class<T> contextClass, ContextParser<T> parser)
    Registers a context parser to a context class necessary for creating a template with a custom type parameter.
    void
    registerGlobalReplacer(dev.aurelium.slate.function.ItemReplacer replacer)
    Registers a placeholder replacer that applies to placeholders in all menus.
  • Method Details

    • buildMenu

      void buildMenu(String name, Consumer<dev.aurelium.slate.builder.MenuBuilder> menu)
      Provides access to a MenuBuilder for building a Slate menu. If the name is not an AuraSkills default menu, a new MenuBuilder is created and registered to Slate. Otherwise, the menu builder for an existing menu will be provided to extend an existing menu.
      Parameters:
      name - the name of the menu
      menu - a consumer for the menu builder
    • openMenu

      void openMenu(org.bukkit.entity.Player player, String name)
      Opens a menu for a player with the given name.
      Parameters:
      player - the player to open the menu for
      name - the name of the menu as registered in Slate
    • openMenu

      void openMenu(org.bukkit.entity.Player player, String name, Map<String,Object> properties)
      Opens a menu for a player with the given name and properties.
      Parameters:
      player - the player to open the menu for
      name - the name of the menu as registered in Slate
      properties - the properties to pass to the menu
    • openMenu

      void openMenu(org.bukkit.entity.Player player, String name, Map<String,Object> properties, int page)
      Opens a menu for a player with the given name, properties, and page.
      Parameters:
      player - the player to open the menu for
      name - the name of the menu as registered in Slate
      properties - the properties to pass to the menu
      page - the page to open the menu to
    • openLevelProgressionMenu

      void openLevelProgressionMenu(org.bukkit.entity.Player player, Skill skill)
      Opens the AuraSkills level progression menu for a player. Required properties and the correct page to open to are automatically handled by this method versus the generic openMenu methods.
      Parameters:
      player - the player to open the menu for
      skill - the skill to open to
    • registerContext

      <T> void registerContext(String key, Class<T> contextClass, ContextParser<T> parser)
      Registers a context parser to a context class necessary for creating a template with a custom type parameter.
      Type Parameters:
      T - the type class
      Parameters:
      key - the name of the type in CamelCase
      contextClass - the Class instance of the type being registered
      parser - a parser that takes in a menuName String and input String to parse the type
    • registerGlobalReplacer

      void registerGlobalReplacer(dev.aurelium.slate.function.ItemReplacer replacer)
      Registers a placeholder replacer that applies to placeholders in all menus. If a placeholder shouldn't be replaced, the ItemReplacer should return null to not replace, so other global replacers can check that placeholder.
      Parameters:
      replacer - the placeholder replacer that takes a PlaceholderInfo argument and returns the replaced String.