Skip to Content
⚠ Under Construction
ReferenceC++ APIMapView

endstone::MapView

Represents a map item.

Types:

NameDescription
ScaleAn enum representing all possible scales a map can be set to.

Functions:

NameDescription
addRendererAdd a renderer to this map.
getCenterXGet the center X position of this map.
getCenterZGet the center Z position of this map.
getDimensionGet the dimension that this map is associated with.
getIdGet the ID of this map item for use with MapMeta .
getRenderersGet a list of MapRenderers currently in effect.
getScaleGet the scale of this map.
isLockedGets whether the map is locked or not. A locked map may not be explored further.
isUnlimitedTrackingWhether the map will show a smaller position cursor (true), or no position cursor (false) when cursor is outside of map’s range.
isVirtualCheck whether this map is virtual.
removeRendererRemove a renderer from this map.
setCenterXSet the center X position of this map.
setCenterZSet the center Z position of this map.
setDimensionSet the dimension that this map is associated with.
setLockedSets whether the map is locked or not. A locked map may not be explored further.
setScaleSet the scale of this map.
setUnlimitedTrackingWhether 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:

getCenterX

int getCenterX() const

Get the center X position of this map.

Returns:

The center X position.

getCenterZ

int getCenterZ() const

Get the center Z position of this map.

Returns:

The center Z position.

getDimension

Dimension *getDimension() const

Get 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() const

Get the ID of this map item for use with MapMeta .

Returns:

The unique ID of the map.

getRenderers

std::vector<MapRenderer *> getRenderers() const

Get a list of MapRenderers currently in effect.

Returns:

A list of references to each MapRenderer.

getScale

Scale getScale() const

Get the scale of this map.

Returns:

The scale of the map.

isLocked

bool isLocked() const

Gets 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() const

Whether 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() const

Check 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:

Returns:

True if the renderer was successfully removed.

setCenterX

void setCenterX(int x)

Set the center X position of this map.

Parameters:

  • x The center X position.

setCenterZ

void setCenterZ(int z)

Set the center Z position of this map.

Parameters:

  • z The center Z position.

setDimension

void setDimension(const Dimension &dimension)

Set the dimension that this map is associated with.

Parameters:

  • dimension The 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:

  • locked True to lock the map.

setScale

void setScale(Scale scale)

Set the scale of this map.

Parameters:

  • scale The 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:

  • unlimited True to enable unlimited tracking.
Last updated on