endstone::MapView
Represents a map item.
Types:
| Name | Description |
|---|---|
Scale | An enum representing all possible scales a map can be set to. |
Functions:
| Name | Description |
|---|---|
addRenderer | Add a renderer to this map. |
getCenterX | Get the center X position of this map. |
getCenterZ | Get the center Z position of this map. |
getDimension | Get the dimension that this map is associated with. |
getId | Get the ID of this map item for use with MapMeta . |
getRenderers | Get a list of MapRenderers currently in effect. |
getScale | Get the scale of this map. |
isLocked | Gets whether the map is locked or not. A locked map may not be explored further. |
isUnlimitedTracking | Whether the map will show a smaller position cursor (true), or no position cursor (false) when cursor is outside of map’s range. |
isVirtual | Check whether this map is virtual. |
removeRenderer | Remove a renderer from this map. |
setCenterX | Set the center X position of this map. |
setCenterZ | Set the center Z position of this map. |
setDimension | Set the dimension that this map is associated with. |
setLocked | Sets whether the map is locked or not. A locked map may not be explored further. |
setScale | Set the scale of this map. |
setUnlimitedTracking | Whether the map will show a smaller position cursor (true), or no position cursor (false) when cursor is outside of map’s range. |
Scale
enum Scale { Closest = 0, Close = 1, Normal = 2, Far = 3, Farthest = 4 };An enum representing all possible scales a map can be set to.
addRenderer
void addRenderer(std::shared_ptr<MapRenderer> renderer)Add a renderer to this map.
Parameters:
rendererThe MapRenderer to add.
getCenterX
int getCenterX() constGet the center X position of this map.
Returns:
The center X position.
getCenterZ
int getCenterZ() constGet the center Z position of this map.
Returns:
The center Z position.
getDimension
Dimension *getDimension() constGet the dimension that this map is associated with.
Returns:
Pointer to the World this map is associated with, or nullptr.
getId
std::int64_t getId() constGet the ID of this map item for use with MapMeta .
Returns:
The unique ID of the map.
getRenderers
std::vector<MapRenderer *> getRenderers() constGet a list of MapRenderers currently in effect.
Returns:
A list of references to each MapRenderer.
getScale
Scale getScale() constGet the scale of this map.
Returns:
The scale of the map.
isLocked
bool isLocked() constGets whether the map is locked or not. A locked map may not be explored further.
Returns:
True if the map is locked.
isUnlimitedTracking
bool isUnlimitedTracking() constWhether the map will show a smaller position cursor (true), or no position cursor (false) when cursor is outside of map’s range.
Returns:
True if unlimited tracking is enabled.
isVirtual
bool isVirtual() constCheck whether this map is virtual.
A map is virtual if its lowermost MapRenderer is plugin-provided.
Returns:
True if the map is virtual.
removeRenderer
bool removeRenderer(MapRenderer *renderer)Remove a renderer from this map.
Parameters:
rendererThe MapRenderer to remove.
Returns:
True if the renderer was successfully removed.
setCenterX
void setCenterX(int x)Set the center X position of this map.
Parameters:
xThe center X position.
setCenterZ
void setCenterZ(int z)Set the center Z position of this map.
Parameters:
zThe center Z position.
setDimension
void setDimension(const Dimension &dimension)Set the dimension that this map is associated with.
Parameters:
dimensionThe Dimension to associate this map with.
setLocked
void setLocked(bool locked)Sets whether the map is locked or not. A locked map may not be explored further.
Parameters:
lockedTrue to lock the map.
setScale
void setScale(Scale scale)Set the scale of this map.
Parameters:
scaleThe scale to set.
setUnlimitedTracking
void setUnlimitedTracking(bool unlimited)Whether the map will show a smaller position cursor (true), or no position cursor (false) when cursor is outside of map’s range.
Parameters:
unlimitedTrue to enable unlimited tracking.