3D biomes
This commit is contained in:
@@ -34,7 +34,12 @@ self.onmessage = (event: MessageEvent<{ port: MessagePort }>) => {
|
||||
try {
|
||||
const raw = (await loaded!).generate(x, z);
|
||||
const sections = raw.column.sections.map((section) => section.data);
|
||||
const buffers = sections.flatMap((data) => typeof data === "number" ? [] : [data.buffer]);
|
||||
// sections can share their biomes' array
|
||||
const buffers = new Set(
|
||||
[...sections, ...raw.column.biomes.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,
|
||||
|
||||
Reference in New Issue
Block a user