Skip to content

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

world/generators/datadriven/bedrockSections ​

Interfaces ​

BedrockSection ​

Defined in: packages/prismarine/src/world/generators/datadriven/bedrockSections.ts:33

One section that holds anything besides air.

Properties ​

blocks ​

readonly blocks: Uint16Array<ArrayBuffer>

Defined in: packages/prismarine/src/world/generators/datadriven/bedrockSections.ts:37

Indices into palette, in Bedrock's x, z, y order.

palette ​

readonly palette: Int32Array<ArrayBuffer>

Defined in: packages/prismarine/src/world/generators/datadriven/bedrockSections.ts:39

Runtime ids, air first, in order of first appearance.

section ​

readonly section: number

Defined in: packages/prismarine/src/world/generators/datadriven/bedrockSections.ts:35

The section index, y >> 4.

water? ​

readonly optional water?: Uint16Array<ArrayBuffer>

Defined in: packages/prismarine/src/world/generators/datadriven/bedrockSections.ts:41

Layer 1: 1 where the block is waterlogged. Absent when nothing in the section is.


BedrockSectionsInput ​

Defined in: packages/prismarine/src/world/generators/datadriven/bedrockSections.ts:17

What the block pass reads. Every field is plain data, so it crosses a thread or a process.

Properties ​

air ​

readonly air: number

Defined in: packages/prismarine/src/world/generators/datadriven/bedrockSections.ts:27

columnTops ​

readonly columnTops: Int32Array

Defined in: packages/prismarine/src/world/generators/datadriven/bedrockSections.ts:22

The highest block of each of the 256 columns, or minY - 1 for an empty column.

height ​

readonly height: number

Defined in: packages/prismarine/src/world/generators/datadriven/bedrockSections.ts:29

kind ​

readonly kind: "bedrock-sections"

Defined in: packages/prismarine/src/world/generators/datadriven/bedrockSections.ts:18

minY ​

readonly minY: number

Defined in: packages/prismarine/src/world/generators/datadriven/bedrockSections.ts:28

runtimeIds ​

readonly runtimeIds: Int32Array

Defined in: packages/prismarine/src/world/generators/datadriven/bedrockSections.ts:24

The Bedrock runtime id of each region palette slot, already mapped to air when unknown.

slots ​

readonly slots: Uint16Array

Defined in: packages/prismarine/src/world/generators/datadriven/bedrockSections.ts:20

The center chunk's palette slot of every block, column by column, each column height long.

waterSlots ​

readonly waterSlots: Uint8Array

Defined in: packages/prismarine/src/world/generators/datadriven/bedrockSections.ts:26

1 for a palette slot whose Java state is waterlogged, which Bedrock keeps in layer 1.

Variables ​

BLOCKS_PER_SECTION ​

const BLOCKS_PER_SECTION: 4096 = 4096

Defined in: packages/prismarine/src/world/generators/datadriven/bedrockSections.ts:14

Blocks in one 16 by 16 by 16 section.

Functions ​

buildBedrockSections() ​

buildBedrockSections(input): BedrockSection[]

Defined in: packages/prismarine/src/world/generators/datadriven/bedrockSections.ts:52

Builds every non-empty section.

Within a section, a runtime id gets a palette entry the first time a block with it is visited, visiting x, then z, then y, which is what BlockStorage.setBlock would have produced. Two region slots that translate to the same runtime id share an entry. A section whose palette never grows past air is left out.

Parameters ​

input ​

BedrockSectionsInput

Returns ​

BedrockSection[]


isBedrockSections() ​

isBedrockSections(value): value is BedrockSection[]

Defined in: packages/prismarine/src/world/generators/datadriven/bedrockSections.ts:141

Whether a worker's answer is a list of sections. Checked when it arrives on the server thread.

Parameters ​

value ​

unknown

Returns ​

value is BedrockSection[]


isBedrockSectionsInput() ​

isBedrockSectionsInput(value): value is BedrockSectionsInput

Defined in: packages/prismarine/src/world/generators/datadriven/bedrockSections.ts:120

Whether a task input asks for the block pass. Checked at the worker boundary.

Parameters ​

value ​

unknown

Returns ​

value is BedrockSectionsInput


sectionBuffers() ​

sectionBuffers(sections): ArrayBuffer[]

Defined in: packages/prismarine/src/world/generators/datadriven/bedrockSections.ts:112

Every buffer the sections own, so a worker moves them rather than copying.

Parameters ​

sections ​

readonly BedrockSection[]

Returns ​

ArrayBuffer[]