endstone.map
Classes:
Name | Description |
---|---|
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. |
MapRenderer | Represents a renderer for a map. |
MapView | Represents 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:
Name | Description |
---|---|
draw_image | Draw an image to the map. The image will be clipped if necessary. |
get_base_pixel_color | Get a pixel from the layers below this canvas. |
get_pixel_color | Get a pixel from the canvas. |
set_pixel_color | Draw a pixel to the canvas. |
Attributes:
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:
Name | Description |
---|---|
initialize | Initialize this MapRenderer for the given map. |
render | Render 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:
Name | Description |
---|---|
Scale | An enum representing all possible scales a map can be set to. |
Methods:
Name | Description |
---|---|
add_renderer | Add a renderer to this map. |
remove_renderer | Remove a renderer from this map. |
Attributes:
Name | Type | Description |
---|---|---|
center_x | int | Get or set the center X position of this map. |
center_z | int | Get or set the center Z position of this map. |
dimension | Dimension | Get or set the dimension that this map is associated with. |
id | int | Get the ID of this map item for use with MapMeta. |
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 | bool | Check whether this map is virtual. |
locked | bool | Whether the map is locked or not. A locked map may not be explored further. |
renderers | list[MapRenderer] | Get a copied list of MapRenderers currently in effect. |
scale | Scale | Get 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.