3D biomes

This commit is contained in:
2026-11-07 12:13:43 -03:00
parent b726ce9695
commit 22191d260c
53 changed files with 874 additions and 316 deletions
+4 -2
View File
@@ -90,7 +90,8 @@ export function setup(gen: WorldgenContext) {
}
```
`step` and `biomes` are optional. With `biomes`, the feature only runs in chunks that have one of them.
`step` and `biomes` are optional. With `biomes`, the feature only runs in chunks that have one of them somewhere, at any
height, the way a NeoForge biome modifier adds a feature to the biomes it lists.
Feature ids are in the mod's namespace. Each feature's `rng` is seeded with the world's seed, the chunk and the
feature's id, so adding another mod's feature doesn't change what this one generates.
@@ -107,7 +108,8 @@ interface FeatureChunk {
noise_2d(name: string): (x: number, z: number) => number;
noise_3d(name: string): (x: number, y: number, z: number) => number;
height_at(x: number, z: number): number; // surface height, inside this chunk only
biome_at(x: number, z: number): string; // like "bworld:plains", inside this chunk only
biome_at(x: number, y: number, z: number): string; // like "bworld:plains", inside this chunk only
set_biome(x: number, y: number, z: number, biome: string): void; // the 4 blocks tall cell y is in, see biomes.md
get_block(x: number, y: number, z: number): string | undefined; // inside this chunk only
set_block(x: number, y: number, z: number, id: string): void; // up to one chunk away
place_feature(id: string, x: number, y: number, z: number): boolean; // a data feature, see below