mirror of
https://github.com/danbulant/flying-squid
synced 2026-07-05 19:20:54 +00:00
Fix grass under water
This commit is contained in:
parent
b93f00da21
commit
4e091873d4
1 changed files with 4 additions and 2 deletions
|
|
@ -94,9 +94,10 @@ function DiamondSquare(size, roughness, seed) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function generation({seed,worldHeight=80}={}) {
|
function generation({seed,worldHeight=80}={}) {
|
||||||
// Selected empirically
|
// Selected empirically
|
||||||
var size = 10000000;
|
var size = 10000000;
|
||||||
var space = new DiamondSquare(size, size / 1000, seed);
|
var space = new DiamondSquare(size, size / 1000, seed);
|
||||||
|
var waterline = 20;
|
||||||
|
|
||||||
function generateSimpleChunk(chunkX, chunkZ) {
|
function generateSimpleChunk(chunkX, chunkZ) {
|
||||||
var chunk = new Chunk();
|
var chunk = new Chunk();
|
||||||
|
|
@ -112,8 +113,9 @@ function generation({seed,worldHeight=80}={}) {
|
||||||
|
|
||||||
if (y == 0) block = 7;
|
if (y == 0) block = 7;
|
||||||
else if (y < level) block = 3;
|
else if (y < level) block = 3;
|
||||||
|
else if (y == level && y < waterline) block = 3;
|
||||||
else if (y == level) block = 2;
|
else if (y == level) block = 2;
|
||||||
else if (y < 20) block = 9;
|
else if (y < waterline) block = 9;
|
||||||
|
|
||||||
if (block) chunk.setBlockType(new Vec3(x, y, z), block);
|
if (block) chunk.setBlockType(new Vec3(x, y, z), block);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue