Class MapData

java.lang.Object
org.bukkit.map.MapRenderer
studio.magemonkey.codex.mccore.gui.MapData

public class MapData extends org.bukkit.map.MapRenderer
Represents the data for a map hierarchy. These should only be set up by the MapMenuManager. Use that class to set up and manage menus instead.
  • Constructor Summary

    Constructors
    Constructor
    Description
    MapData(MapMenu root, org.bukkit.map.MapView view)
    Initializes a new renderer and data set for a map view using the given menu as the root of the hierarchy.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    back(org.bukkit.entity.Player player)
    Returns a player back to the previous map menu in the hierarchy if they are not already at the root level.
    void
    clear(org.bukkit.entity.Player player)
    Removes the menu data for a player
    org.bukkit.inventory.ItemStack
    Retrieves the map ItemStack representing this menu hierarchy.
    getMenu(org.bukkit.entity.Player player)
    Retrieves the current menu being seen by a specific player
    void
    next(org.bukkit.entity.Player player, MapMenu menu)
    Sends a player to the next menu in the hierarchy if they are currently at the parent menu.
    void
    render(org.bukkit.map.MapView mapView, org.bukkit.map.MapCanvas mapCanvas, org.bukkit.entity.Player player)
    Renders to the map canvas each frame

    Methods inherited from class org.bukkit.map.MapRenderer

    initialize, isContextual

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • MapData

      public MapData(MapMenu root, org.bukkit.map.MapView view)
      Initializes a new renderer and data set for a map view using the given menu as the root of the hierarchy.
      Parameters:
      root - root map menu
      view - view to set up renderer for
  • Method Details

    • render

      public void render(org.bukkit.map.MapView mapView, org.bukkit.map.MapCanvas mapCanvas, org.bukkit.entity.Player player)
      Renders to the map canvas each frame
      Specified by:
      render in class org.bukkit.map.MapRenderer
      Parameters:
      mapView - the map view owning the canvas
      mapCanvas - the canvas to draw to
      player - the player looking at the map
    • getMapItem

      public org.bukkit.inventory.ItemStack getMapItem()
      Retrieves the map ItemStack representing this menu hierarchy.
      Returns:
      map ItemStack for the menu
    • getMenu

      public MapMenu getMenu(org.bukkit.entity.Player player)
      Retrieves the current menu being seen by a specific player
      Parameters:
      player - player to retrieve the current map for
      Returns:
      the current map the player is viewing
    • back

      public void back(org.bukkit.entity.Player player)
      Returns a player back to the previous map menu in the hierarchy if they are not already at the root level.
      Parameters:
      player - player to return back to the previous menu
    • next

      public void next(org.bukkit.entity.Player player, MapMenu menu)
      Sends a player to the next menu in the hierarchy if they are currently at the parent menu.
      Parameters:
      menu - menu to transition to
    • clear

      public void clear(org.bukkit.entity.Player player)
      Removes the menu data for a player
      Parameters:
      player - player to remove for