Map
endstone.map
¶
Classes relating to plugin handling of map displays.
Classes:
| Name | Description |
|---|---|
MapCanvas |
Represents a canvas for drawing to a map. |
MapCursor |
Represents a cursor on a 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_pixel |
Get a pixel from the canvas. |
get_pixel_color |
Get a pixel from the canvas. |
set_pixel |
Draw a pixel to the canvas. |
set_pixel_color |
Draw a pixel to the canvas. |
Attributes:
| Name | Type | Description |
|---|---|---|
cursors |
list[MapCursor]
|
The cursors associated with this canvas. |
map_view |
MapView
|
The |
MapCursor
¶
Represents a cursor on a map.
Classes:
| Name | Description |
|---|---|
Type |
Represents the standard types of map cursors. |
Attributes:
| Name | Type | Description |
|---|---|---|
caption |
str
|
The caption on this cursor. |
direction |
int
|
The facing of the cursor, from 0 to 15. |
is_visible |
bool
|
The visibility status of this cursor. |
type |
Type
|
The type (color/style) of this map cursor. |
x |
int
|
The X position of this cursor. |
y |
int
|
The Y position of this cursor. |
Type
¶
Bases: Enum
Represents the standard types of map cursors.
Attributes:
MapRenderer
¶
MapRenderer(is_contextual: bool = False)
Represents a renderer for a map.
Initialize the map renderer base with the given contextual status.
Methods:
| Name | Description |
|---|---|
initialize |
Initialize this |
render |
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 |
|---|---|---|
CLOSE |
|
|
CLOSEST |
|
|
FAR |
|
|
FARTHEST |
|
|
NORMAL |
|
|
center_x |
int
|
The center X position of this map. |
center_z |
int
|
The center Z position of this map. |
dimension |
Dimension
|
The dimension that this map is associated with. |
id |
int
|
The unique ID of this map item for use with |
is_unlimited_tracking |
bool
|
Whether the map will show a smaller position cursor ( |
is_virtual |
bool
|
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]
|
A list of |
scale |
Scale
|
The scale of this map. |
is_unlimited_tracking
property
writable
¶
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
property
¶
is_virtual: bool
Whether this map is virtual.
A map is virtual if its lowermost MapRenderer is plugin-provided.
locked
property
writable
¶
locked: bool
Whether the map is locked or not. A locked map may not be explored further.
Scale
¶
add_renderer
¶
add_renderer(renderer: MapRenderer) -> None
Add a renderer to this map.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
renderer
|
MapRenderer
|
The |
required |
remove_renderer
¶
remove_renderer(renderer: MapRenderer) -> bool
Remove a renderer from this map.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
renderer
|
MapRenderer
|
The |
required |
Returns:
| Type | Description |
|---|---|
bool
|
|