API reference / @jsprismarine/prismarine / world/mapRender
world/mapRender
Interfaces
MapColumn
Defined in: packages/prismarine/src/world/mapRender.ts:16
One column of blocks, as a map sees it from above.
Properties
colorId
readonlycolorId:number
Defined in: packages/prismarine/src/world/mapRender.ts:18
The id of the color the map draws it with; see mapColors.ts.
waterDepth
readonlywaterDepth:number
Defined in: packages/prismarine/src/world/mapRender.ts:22
How many fluid blocks lie under the top one, for a column topped by a fluid.
y
readonlyy:number
Defined in: packages/prismarine/src/world/mapRender.ts:20
The height of the block drawn, Java's columnY.
MapTerrain
Defined in: packages/prismarine/src/world/mapRender.ts:26
What a map reads of the dimension it shows.
Properties
hasCeiling
readonlyhasCeiling:boolean
Defined in: packages/prismarine/src/world/mapRender.ts:28
Whether the dimension has a ceiling, which a map draws as noise rather than terrain.
Methods
column()
column(
x,z):MapColumn
Defined in: packages/prismarine/src/world/mapRender.ts:32
The column at a block, in a loaded chunk.
Parameters
x
number
z
number
Returns
isLoaded()
isLoaded(
x,z):boolean
Defined in: packages/prismarine/src/world/mapRender.ts:30
Whether the chunk holding a block is loaded.
Parameters
x
number
z
number
Returns
boolean
Type Aliases
MapPainter
MapPainter = (
x,z,packedColor) =>boolean
Defined in: packages/prismarine/src/world/mapRender.ts:40
Writes one pixel and answers whether it changed, Java's MapItemSavedData.updateColor.
Parameters
x
number
z
number
packedColor
number
Returns
boolean
Java See
MapItemSavedData.updateColor
Functions
updateMapAround()
updateMapAround(
map,holder,terrain,paint):void
Defined in: packages/prismarine/src/world/mapRender.ts:52
Redraws the part of a map near its holder that the holder's step picks.
Parameters
map
Pick<SavedMap, "centerX" | "centerZ" | "scale">
The map's center and scale.
holder
Where the holder stands, in blocks, and its step, which the caller advances once per call as Java's HoldingPlayer.step is.
step
number
x
number
z
number
terrain
The dimension the map shows, which must be the one the holder is in.
paint
Writes a pixel.
Returns
void
Java See
MapItemSavedData$HoldingPlayer.step