3D biomes
This commit is contained in:
@@ -125,11 +125,11 @@ export class NaturalSpawner {
|
||||
if (Math.hypot(world_spawn.x - fx, world_spawn.y - y, world_spawn.z - fz) < MIN_DISTANCE) continue;
|
||||
if (!world.has_chunk(Math.floor(x / CHUNK_SIZE), Math.floor(z / CHUNK_SIZE))) continue;
|
||||
if (!spawn) {
|
||||
spawn = this.#pick(world.biome_at(x, z));
|
||||
spawn = this.#pick(world.biome_at(x, y, z));
|
||||
if (!spawn) break;
|
||||
size = spawn.min_count + this.#int(spawn.max_count - spawn.min_count + 1);
|
||||
}
|
||||
if (distance > MAX_DISTANCE || !spawns_in(spawn, world.biome_at(x, z))) continue;
|
||||
if (distance > MAX_DISTANCE || !spawns_in(spawn, world.biome_at(x, y, z))) continue;
|
||||
// in loaded chunks only, the light too, so trying never builds a chunk
|
||||
if (!world.has_chunks_around(x, z, LIGHT_REACH)) continue;
|
||||
if (!is_spawn_ground(world, x, y - 1, z)) continue;
|
||||
|
||||
Reference in New Issue
Block a user