endstone.map

Classes relating to plugin handling of map displays.

Classes relating to plugin handling of map displays.

Classes

NameDescription
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.

MapCursor

Represents a cursor on a map.

MapRenderer

Represents a renderer for a map.

MapView

Represents a map item.

classMapCanvas

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_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

NameTypeDescription
cursorslist[MapCursor]

Get the cursorS associated with this canvas.

map_viewMapView

Get the map this canvas is attached to.

attrcursorsproperty

cursors: list[MapCursor]

Get the cursorS associated with this canvas.

attrmap_viewproperty

map_view: MapView

Get the map this canvas is attached to.

methdraw_image

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

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

methget_pixel

get_pixel(x: int, y: int) -> int

Get a pixel from the canvas.

methget_pixel_color

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

Get a pixel from the canvas.

methset_pixel

set_pixel(x: int, y: int, color: int) -> None

Draw a pixel to the canvas.

methset_pixel_color

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

Draw a pixel to the canvas.

classMapCursor

MapCursor(x: int, y: int, direction: int, type: Type, visible: bool, caption: str = '')

Represents a cursor on a map.

Classes

NameDescription
Type

Represents the standard types of map cursors.

Attributes

NameTypeDescription
captionstr

Get or set the caption on this cursor.

directionint

Get or set the direction of this cursor

is_visiblebool

Get or set the visibility statis of this cursor.

typeType

Get or set the type of this cursor.

xint

Get or set the X position of this cursor.

yint

Get or set the Y position of this cursor.

attrcaptionproperty

caption: str

Get or set the caption on this cursor.

attrdirectionproperty

direction: int

Get or set the direction of this cursor

attris_visibleproperty

is_visible: bool

Get or set the visibility statis of this cursor.

attrtypeproperty

type: Type

Get or set the type of this cursor.

attrxproperty

x: int

Get or set the X position of this cursor.

attryproperty

y: int

Get or set the Y position of this cursor.

classType

Bases: Enum

Type()

Represents the standard types of map cursors.

attrBLUE_MARKER

BLUE_MARKER = 3

attrCYAN_MARKER

CYAN_MARKER = 11

attrFRAME

FRAME = 1

attrGREEN_POINT

GREEN_POINT = 12

attrJUNGLE_TEMPLE

JUNGLE_TEMPLE = 22

attrMANSION

MANSION = 14

attrMONUMENT

MONUMENT = 15

attrORANGE_MARKER

ORANGE_MARKER = 9

attrPINK_MARKER

PINK_MARKER = 8

attrPLAYER

PLAYER = 0

attrPLAYER_OFF_LIMITS

PLAYER_OFF_LIMITS = 13

attrPLAYER_OFF_MAP

PLAYER_OFF_MAP = 6

attrRED_MARKER

RED_MARKER = 2

attrSIGN_MARKER

SIGN_MARKER = 7

attrSWAMP_HUT

SWAMP_HUT = 23

attrTARGET_POINT

TARGET_POINT = 5

attrTARGET_X

TARGET_X = 4

attrTRIAL_CHAMBERS

TRIAL_CHAMBERS = 24

attrVILLAGE_DESERT

VILLAGE_DESERT = 17

attrVILLAGE_PLAINS

VILLAGE_PLAINS = 18

attrVILLAGE_SAVANNA

VILLAGE_SAVANNA = 19

attrVILLAGE_SNOWY

VILLAGE_SNOWY = 20

attrVILLAGE_TAIGA

VILLAGE_TAIGA = 21

attrYELLOW_MARKER

YELLOW_MARKER = 10

classMapRenderer

MapRenderer(is_contextual: bool = False)

Represents a renderer for a map.

Methods

NameDescription
initialize

Initialize this MapRenderer for the given map.

render

Render to the given map.

methinitialize

initialize(view: MapView) -> None

Initialize this MapRenderer for the given map.

methrender

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

Render to the given map.

classMapView

MapView()

Represents a map item.

Classes

NameDescription
Scale

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

Methods

NameDescription
add_renderer

Add a renderer to this map.

remove_renderer

Remove a renderer from this map.

Attributes

NameTypeDescription
CLOSE
CLOSEST
FAR
FARTHEST
NORMAL
center_xint

Get or set the center X position of this map.

center_zint

Get or set the center Z position of this map.

dimensionDimension

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

idint

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

is_unlimited_trackingbool

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

is_virtualbool

Check whether this map is virtual.

lockedbool

Whether 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.

scaleScale

Get or set the scale of this map.

attrCLOSE

CLOSE

attrCLOSEST

CLOSEST

attrFAR

FAR

attrFARTHEST

FARTHEST

attrNORMAL

NORMAL

attrcenter_xproperty

center_x: int

Get or set the center X position of this map.

attrcenter_zproperty

center_z: int

Get or set the center Z position of this map.

attrdimensionproperty

dimension: Dimension

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

attridproperty

id: int

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

attris_unlimited_trackingproperty

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.

attris_virtualproperty

is_virtual: bool

Check whether this map is virtual.

attrlockedproperty

locked: bool

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

attrrenderersproperty

renderers: list[MapRenderer]

Get a copied list of MapRenderers currently in effect.

attrscaleproperty

scale: Scale

Get or set the scale of this map.

classScale

Bases: IntEnum

Scale()

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

Attributes

attrCLOSE

CLOSE = 1

attrCLOSEST

CLOSEST = 0

attrFAR

FAR = 3

attrFARTHEST

FARTHEST = 4

attrNORMAL

NORMAL = 2

methadd_renderer

add_renderer(renderer: MapRenderer) -> None

Add a renderer to this map.

methremove_renderer

remove_renderer(renderer: MapRenderer) -> bool

Remove a renderer from this map.

On this page