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
Omit<RegionChunkPatch,"blocks"|"structureBlocks">
Properties
blockEntities
readonlyblockEntities: readonlyRegionBlockEntity[]
Defined in: packages/prismarine/src/world/generators/datadriven/GenerationRegion.ts:387
Inherited from
RegionChunkPatch.blockEntities
blockEntityRemovals
readonlyblockEntityRemovals: readonlyRegionBlockEntityRemoval[]
Defined in: packages/prismarine/src/world/generators/datadriven/GenerationRegion.ts:386
Inherited from
RegionChunkPatch.blockEntityRemovals
chunkX
readonlychunkX:number
Defined in: packages/prismarine/src/world/generators/datadriven/GenerationRegion.ts:383
Inherited from
chunkZ
readonlychunkZ:number
Defined in: packages/prismarine/src/world/generators/datadriven/GenerationRegion.ts:384
Inherited from
entitySpawns
readonlyentitySpawns: readonlyRegionEntitySpawn[]
Defined in: packages/prismarine/src/world/generators/datadriven/GenerationRegion.ts:388
Inherited from
fluidTicks?
readonlyoptionalfluidTicks?: readonlyRegionFluidTick[]
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
palette
readonlypalette: readonlyRegionBlock[]
Defined in: packages/prismarine/src/world/generators/datadriven/featurePatchWire.ts:23
The distinct blocks the writes place, by identity.
structureBlocks
readonlystructureBlocks:ArrayBuffer
Defined in: packages/prismarine/src/world/generators/datadriven/featurePatchWire.ts:32
Int32Array of x, y and z for each structure block.
writeBlocks
readonlywriteBlocks: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
readonlywritePositions: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
readonlypayload:PackedRegionChunkPatch[]
transferList
readonlytransferList: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
Throws
TypeError when the payload is not a packed patch list, or a write names a block the palette does not hold.