Move trees out of cubi

This commit is contained in:
2026-11-13 22:55:30 -03:00
parent d48fa8cca5
commit c74ddedd6e
23 changed files with 69 additions and 208 deletions
+18 -27
View File
@@ -1,8 +1,9 @@
# Biomes
A biome says what the ground looks like where it's picked: the blocks on top, the colors grass, leaves and water are
tinted, which trees grow, and whether it has a season of its own. Biomes are data, one file each in a mod's
`worldgen/biomes/` folder. The base game's are in `mods/bworld/worldgen/biomes/`.
tinted, and whether it has a season of its own. What grows on it is up to features, see [Features](index.md#features).
Biomes are data, one file each in a mod's `worldgen/biomes/` folder. The base game's are in
`mods/bworld/worldgen/biomes/`.
Which biome a place gets is up to the generator's biome rules, from the column's climate, the ground's height and how
far under it the place is. A mod's biome generates where a rule it adds puts it, see
@@ -32,37 +33,27 @@ so is the filler under them.
"grass": "#507a32",
"foliage": "#59ae30",
"water": "#3f76e4"
},
"trees": {
"chance": 1,
"kinds": ["big_oak", "big_oak", "oak"],
"wood": { "big_oak": "dark_oak" }
}
}
}
```
| Field | What it does | When not set |
| --------------------------- | ---------------------------------------------------------------------------------------- | ------------ |
| `id` | in your mod's namespace | required |
| `season` | `spring`, `summer`, `autumn` or `winter`, always, see [Seasons](#seasons) | the calendar |
| `surface.top` | the block on top of the ground | required |
| `surface.filler` | the blocks under it | required |
| `surface.filler_depth` | how many blocks of filler, 0 to 32. Stone is below | required |
| `surface.underwater_top` | the top block where the ground is under water | `filler` |
| `surface.underwater_filler` | the filler under water | `filler` |
| `surface.bare_cliffs` | steep ground shows stone instead of `top` | `false` |
| `colors.grass` | what blocks with `"tint": { "color": "grass" }` are drawn in, as `#rrggbb` | plains' |
| `colors.foliage` | the same for `"foliage"`, like leaves | plains' |
| `colors.water` | the same for `"water"` | plains' |
| `trees.chance` | how likely each tree spot is to get a tree, 0 to 1. Spots are at least 4 blocks apart | no trees |
| `trees.kinds` | which trees grow, picked evenly: list one twice to make it twice as likely | |
| `trees.wood` | the logs and leaves a kind grows here when it isn't its own, like dark oak for `big_oak` | |
| Field | What it does | When not set |
| --------------------------- | -------------------------------------------------------------------------- | ------------ |
| `id` | in your mod's namespace | required |
| `season` | `spring`, `summer`, `autumn` or `winter`, always, see [Seasons](#seasons) | the calendar |
| `surface.top` | the block on top of the ground | required |
| `surface.filler` | the blocks under it | required |
| `surface.filler_depth` | how many blocks of filler, 0 to 32. Stone is below | required |
| `surface.underwater_top` | the top block where the ground is under water | `filler` |
| `surface.underwater_filler` | the filler under water | `filler` |
| `surface.bare_cliffs` | steep ground shows stone instead of `top` | `false` |
| `colors.grass` | what blocks with `"tint": { "color": "grass" }` are drawn in, as `#rrggbb` | plains' |
| `colors.foliage` | the same for `"foliage"`, like leaves | plains' |
| `colors.water` | the same for `"water"` | plains' |
Tree kinds are `oak`, `big_oak`, `birch`, `spruce`, `jungle`, `acacia` and `cherry`. Woods are `oak`, `spruce`, `birch`,
`jungle`, `acacia`, `dark_oak` and `cherry`. Trees only grow on grass, dirt or snow with air above. They're the base
game's trees feature (`mods/bworld/scripts/trees.ts`), which reads every biome's `trees`. It checks the kinds and woods
when the server starts, so `check-mods` doesn't.
The base game's trees are a feature of its own, not part of biomes: `BIOME_TREES` in `mods/bworld/scripts/trees.ts` says
which kinds grow in each of its biomes, how often, and in which wood.
Above the snow line, around y 176, the top block is snow whatever the biome says.
-3
View File
@@ -125,9 +125,6 @@ cell agrees on where its tree is.
`set_block` can write up to one chunk away, so a tree near the border can grow into the next chunk. Writes into another
chunk only fill air, so the result doesn't depend on which chunk generates first.
`gen.biomes()` lists every biome mods added, with their `trees`, for features that read biomes' data the way the base
game's trees do.
Generated blocks don't run `on_create`, and worldgen scripts can't use the server or client API.
### Data Features
+1 -2
View File
@@ -30,8 +30,7 @@ Ids can have folders, like `bworld:overworld/erosion` in `worldgen/density_funct
steep.
3. Each solid block goes through the `surface_rule`, which gives grass, sand, snow and so on, or `default_block`.
4. Each empty block below the surface of a `fluid` gets it, like water up to sea level.
5. Then [ores](index.md#ores) and [features](index.md#features), like the base game's trees, which grow as the biome's
`trees` say.
5. Then [ores](index.md#ores) and [features](index.md#features), like the base game's trees.
## Noises