Class MapMenuManager

java.lang.Object
studio.magemonkey.codex.mccore.gui.MapMenuManager

public class MapMenuManager extends Object
Handles setting up
  • Constructor Details

    • MapMenuManager

      public MapMenuManager()
  • Method Details

    • getData

      public static MapData getData(String menuKey)
      q Creates a map item for the given map menu
      Parameters:
      menuKey - key of the menu the map should show
    • registerMenu

      public static void registerMenu(String key, MapMenu root)
      Creates a new menu view using the given menu as the root. The root menu cannot backtrack to any other menus, only progress into child menus.
      Parameters:
      key - key to use for the menu group
      root - root of the menu chain
    • getActiveMenuData

      public static MapData getActiveMenuData(org.bukkit.entity.Player player)
      Retrieves the map menu a player is looking at, if any. When a player is not holding a map menu, this will instead return null.
      Parameters:
      player - player to get the menu for
      Returns:
      active map menu or null if not found
    • sendBack

      public static void sendBack(org.bukkit.entity.Player player)
      Sends a player back one level in their current menu chain.
      Parameters:
      player - player to send back to the previous menu
    • sendNext

      public static void sendNext(org.bukkit.entity.Player player, MapMenu menu)
      Sends a player forward one level to the given menu. If the player is not currently at the parent menu of the new one, this will not do anything. You must follow the chain of menus for a given hierarchy.
      Parameters:
      player - player to send back to the previous menu