Skip to Content
⚠ Under Construction

endstone.map

Classes:

NameDescription
MapCanvasRepresents a canvas for drawing to a map. Each canvas is associated with a specific MapRenderer and represents that renderer’s layer on the map.
MapRendererRepresents a renderer for a map.
MapViewRepresents a map item.

MapCanvas

Represents a canvas for drawing to a map. Each canvas is associated with a specific MapRenderer and represents that renderer’s layer on the map.

Methods:

NameDescription
draw_imageDraw an image to the map. The image will be clipped if necessary.
get_base_pixel_colorGet a pixel from the layers below this canvas.
get_pixel_colorGet a pixel from the canvas.
set_pixel_colorDraw a pixel to the canvas.

Attributes:

NameTypeDescription
map_viewMapViewGet the map this canvas is attached to.

map_view

map_view: MapView

Get the map this canvas is attached to.

draw_image

draw_image(x:int, y:int, image:ndarray[uint8]) -> None

Draw an image to the map. The image will be clipped if necessary.

get_base_pixel_color

get_base_pixel_color(x:int, y:int) -> tuple[int, ...]

Get a pixel from the layers below this canvas.

get_pixel_color

get_pixel_color(x:int, y:int) -> tuple[int, ...] | None

Get a pixel from the canvas.

If no color is set at the given position for this canvas, then None is returned and the color returned by get_base_pixel_color() is shown on the map

set_pixel_color

set_pixel_color(x:int, y:int, color:tuple[int, ...] | None) -> None

Draw a pixel to the canvas.

If None is used as color, then the color returned by get_base_pixel_color() is shown on the map.

MapRenderer

MapRenderer(is_contextual:bool = False)

Represents a renderer for a map.

Methods:

NameDescription
initializeInitialize this MapRenderer for the given map.
renderRender to the given map.

Initialize the map renderer base with the given contextual status.

initialize

initialize(view:MapView) -> None

Initialize this MapRenderer for the given map.

render

render(map:MapView, canvas:MapCanvas, player:Player) -> None

Render to the given map.

MapView

Represents a map item.

Classes:

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

Methods:

NameDescription
add_rendererAdd a renderer to this map.
remove_rendererRemove a renderer from this map.

Attributes:

NameTypeDescription
center_xintGet or set the center X position of this map.
center_zintGet or set the center Z position of this map.
dimensionDimensionGet or set the dimension that this map is associated with.
idintGet the ID of this map item for use with MapMeta.
is_unlimited_trackingboolWhether the map will show a smaller position cursor (true), or no position cursor (false) when cursor is outside of map’s range.
is_virtualboolCheck whether this map is virtual.
lockedboolWhether the map is locked or not. A locked map may not be explored further.
rendererslist[MapRenderer]Get a copied list of MapRenderers currently in effect.
scaleScaleGet or set the scale of this map.

center_x

center_x: int

Get or set the center X position of this map.

center_z

center_z: int

Get or set the center Z position of this map.

dimension

dimension: Dimension

Get or set the dimension that this map is associated with.

id

id: int

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

is_unlimited_tracking

is_unlimited_tracking: bool

Whether the map will show a smaller position cursor (true), or no position cursor (false) when cursor is outside of map’s range.

is_virtual

is_virtual: bool

Check whether this map is virtual.

locked

locked: bool

Whether the map is locked or not. A locked map may not be explored further.

renderers

renderers: list[MapRenderer]

Get a copied list of MapRenderers currently in effect.

scale

scale: MapView.Scale

Get or set the scale of this map.

Scale

Scale(value:int)

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

Attributes:

CLOSE
CLOSE: MapView.Scale
CLOSEST
CLOSEST: MapView.Scale
FAR
FAR: MapView.Scale
FARTHEST
FARTHEST: MapView.Scale
NORMAL
NORMAL: MapView.Scale
name
name: str
value
value: int

add_renderer

add_renderer(renderer:MapRenderer) -> None

Add a renderer to this map.

remove_renderer

remove_renderer(renderer:MapRenderer) -> bool

Remove a renderer from this map.

Last updated on