Small fixes

This commit is contained in:
Paul Mathieu
2021-12-25 02:28:06 -08:00
parent 86a65fc39c
commit 0c381e26d3
2 changed files with 12 additions and 8 deletions

View File

@@ -115,9 +115,10 @@ function makeChunk(z, x) {
data.set(Array(waterHeight - currentHeight).fill(BlockType.WATER), offset + currentHeight);
currentHeight = waterHeight;
} else {
data[offset + grassHeight - 1] = BlockType.GRASS;
if (hasATree(seed, z + i, x + j)) {
trees.push([i, j, currentHeight]);
} else {
data[offset + grassHeight - 1] = BlockType.GRASS;
}
}
data.set(Array(256 - currentHeight).fill(BlockType.AIR), offset + currentHeight);