Skip to content

API reference / @jsprismarine/worldgen / CarvingMask

Class: CarvingMask ​

Defined in: carver/CarvingMask.ts:26

The set of blocks a chunk's carvers opened, before anything is removed from the chunk.

Java separates the two steps so that one pass over 289 source chunks can accumulate every carver's openings and the chunk is then edited once. visit walks the result as vertical runs, which is the order the edit wants.

Implements ​

Constructors ​

Constructor ​

new CarvingMask(minY, maxY): CarvingMask

Defined in: carver/CarvingMask.ts:35

Parameters ​

minY ​

number

maxY ​

number

Returns ​

CarvingMask

Properties ​

maxY ​

readonly maxY: number

Defined in: carver/CarvingMask.ts:30

The highest y the carver may open.

Implementation of ​

CarverOutput.maxY


minY ​

readonly minY: number

Defined in: carver/CarvingMask.ts:28

The lowest y the carver may open.

Implementation of ​

CarverOutput.minY

Accessors ​

carvedCount ​

Get Signature ​

get carvedCount(): number

Defined in: carver/CarvingMask.ts:61

How many blocks the mask opened, which is the volume a distribution check measures.

Returns ​

number

Methods ​

carve() ​

carve(localX, y, localZ): void

Defined in: carver/CarvingMask.ts:51

Opens one block, addressed by its position inside the chunk.

Parameters ​

localX ​

number

y ​

number

localZ ​

number

Returns ​

void

Implementation of ​

CarverOutput.carve


isCarved() ​

isCarved(localX, y, localZ): boolean

Defined in: carver/CarvingMask.ts:56

Whether one block is open.

Parameters ​

localX ​

number

y ​

number

localZ ​

number

Returns ​

boolean


isEmpty() ​

isEmpty(): boolean

Defined in: carver/CarvingMask.ts:68

Whether nothing was opened.

Returns ​

boolean


visit() ​

visit(visitor): void

Defined in: carver/CarvingMask.ts:73

Reports every run of open blocks, column by column, lowest index first.

Parameters ​

visitor ​

CarvingMaskVisitor

Returns ​

void


forChunk() ​

static forChunk(context): CarvingMask

Defined in: carver/CarvingMask.ts:46

Builds the mask a chunk generator uses, which spans the dimension minus one block at the bottom and seven at the top.

Parameters ​

context ​

WorldGenerationContext

Returns ​

CarvingMask