Skip to content

API reference / @jsprismarine/prismarine / world/generators/datadriven/featurePatchWire

world/generators/datadriven/featurePatchWire ​

Interfaces ​

PackedRegionChunkPatch ​

Defined in: packages/prismarine/src/world/generators/datadriven/featurePatchWire.ts:21

One chunk's patch, packed.

Extends ​

Properties ​

blockEntities ​

readonly blockEntities: readonly RegionBlockEntity[]

Defined in: packages/prismarine/src/world/generators/datadriven/GenerationRegion.ts:387

Inherited from ​

RegionChunkPatch.blockEntities

blockEntityRemovals ​

readonly blockEntityRemovals: readonly RegionBlockEntityRemoval[]

Defined in: packages/prismarine/src/world/generators/datadriven/GenerationRegion.ts:386

Inherited from ​

RegionChunkPatch.blockEntityRemovals

chunkX ​

readonly chunkX: number

Defined in: packages/prismarine/src/world/generators/datadriven/GenerationRegion.ts:383

Inherited from ​

RegionChunkPatch.chunkX

chunkZ ​

readonly chunkZ: number

Defined in: packages/prismarine/src/world/generators/datadriven/GenerationRegion.ts:384

Inherited from ​

RegionChunkPatch.chunkZ

entitySpawns ​

readonly entitySpawns: readonly RegionEntitySpawn[]

Defined in: packages/prismarine/src/world/generators/datadriven/GenerationRegion.ts:388

Inherited from ​

RegionChunkPatch.entitySpawns

fluidTicks? ​

readonly optional fluidTicks?: readonly RegionFluidTick[]

Defined in: packages/prismarine/src/world/generators/datadriven/GenerationRegion.ts:390

The fluid ticks a feature asked for in this chunk; see GenerationRegion.scheduleFluidTick.

Inherited from ​

RegionChunkPatch.fluidTicks

palette ​

readonly palette: readonly RegionBlock[]

Defined in: packages/prismarine/src/world/generators/datadriven/featurePatchWire.ts:23

The distinct blocks the writes place, by identity.

structureBlocks ​

readonly structureBlocks: ArrayBuffer

Defined in: packages/prismarine/src/world/generators/datadriven/featurePatchWire.ts:32

Int32Array of x, y and z for each structure block.

writeBlocks ​

readonly writeBlocks: ArrayBuffer

Defined in: packages/prismarine/src/world/generators/datadriven/featurePatchWire.ts:30

Each write's slot in palette: a Uint16Array, or a Uint32Array for a palette past 65,536 blocks, which the byte length tells apart.

writePositions ​

readonly writePositions: ArrayBuffer

Defined in: packages/prismarine/src/world/generators/datadriven/featurePatchWire.ts:25

Uint32Array of each write's position within the chunk, in write order; see packWritePosition.

Functions ​

isPackedPatch() ​

isPackedPatch(patch): patch is PackedRegionChunkPatch

Defined in: packages/prismarine/src/world/generators/datadriven/featurePatchWire.ts:121

Whether a value that crossed a thread or process boundary is one packed patch.

Parameters ​

patch ​

unknown

Returns ​

patch is PackedRegionChunkPatch


packFeaturePatches() ​

packFeaturePatches(patches): object

Defined in: packages/prismarine/src/world/generators/datadriven/featurePatchWire.ts:69

Packs the patches a feature pass returns, or the patches a merge task carries back to a worker.

Writes that are packed already, as the patches a worker sent are, keep their arrays. Those still belong to the patch, which a retried merge reads again, so they are left out of the transfer list and the boundary clones them.

Parameters ​

patches ​

readonly RegionChunkPatch[]

Returns ​

object

The packed patches, and the buffers a worker thread can move rather than copy.

payload ​

readonly payload: PackedRegionChunkPatch[]

transferList ​

readonly transferList: ArrayBuffer[]


unpackFeaturePatches() ​

unpackFeaturePatches(value): RegionChunkPatch[]

Defined in: packages/prismarine/src/world/generators/datadriven/featurePatchWire.ts:143

Rebuilds the patches a feature worker packed, keeping their block writes packed.

Parameters ​

value ​

unknown

The worker's payload, which crossed a boundary the compiler cannot follow.

Returns ​

RegionChunkPatch[]

Throws ​

TypeError when the payload is not a packed patch list, or a write names a block the palette does not hold.