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 -
Method Summary
Modifier and TypeMethodDescriptionvoidback(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.voidclear(org.bukkit.entity.Player player) Removes the menu data for a playerorg.bukkit.inventory.ItemStackRetrieves the map ItemStack representing this menu hierarchy.getMenu(org.bukkit.entity.Player player) Retrieves the current menu being seen by a specific playervoidSends a player to the next menu in the hierarchy if they are currently at the parent menu.voidrender(org.bukkit.map.MapView mapView, org.bukkit.map.MapCanvas mapCanvas, org.bukkit.entity.Player player) Renders to the map canvas each frameMethods inherited from class org.bukkit.map.MapRenderer
initialize, isContextual
-
Constructor Details
-
MapData
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 menuview- 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:
renderin classorg.bukkit.map.MapRenderer- Parameters:
mapView- the map view owning the canvasmapCanvas- the canvas to draw toplayer- 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
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
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
-