World sections
This commit is contained in:
@@ -33,8 +33,10 @@ self.onmessage = (event: MessageEvent<{ port: MessagePort }>) => {
|
||||
const { x, z } = message;
|
||||
try {
|
||||
const raw = (await loaded!).generate(x, z);
|
||||
send({ type: "chunk", x, z, blocks: raw.blocks, spills: raw.spills, biomes: raw.biomes }, [
|
||||
raw.blocks.buffer,
|
||||
const sections = raw.column.sections.map((section) => section.data);
|
||||
const buffers = sections.flatMap((data) => typeof data === "number" ? [] : [data.buffer]);
|
||||
send({ type: "chunk", x, z, sections, spills: raw.spills, biomes: raw.column.biomes }, [
|
||||
...buffers,
|
||||
raw.spills.buffer,
|
||||
]);
|
||||
} catch (e) {
|
||||
|
||||
Reference in New Issue
Block a user