World gen stuff

This commit is contained in:
2026-11-13 00:01:59 -03:00
parent e013fbe550
commit e8ca9753f5
25 changed files with 645 additions and 162 deletions
+5 -4
View File
@@ -38,7 +38,7 @@ at y 64.
"ores": [
{
"id": "copper_tools:rich_copper_ore",
"replaces": "bworld:stone",
"replaces": "#bworld:raw_rocks",
"min_y": 5,
"max_y": 40,
"scale": 0.05,
@@ -48,9 +48,10 @@ at y 64.
}
```
Every block in the chunk that is `replaces` and between `min_y` and `max_y` becomes the first ore whose 3D noise,
sampled at `(x, y, z) × scale`, is above `threshold`. A smaller `scale` makes bigger veins, and a higher `threshold`
makes rarer ones. Each ore's noise is seeded with its id, so ores don't line up with each other.
`replaces` is a block, a `#tag` of blocks, or a list of those, like `["bworld:stone", "#bworld:raw_rocks"]`. Every block
in the chunk that is one of them and between `min_y` and `max_y` becomes the first ore whose 3D noise, sampled at
`(x, y, z) × scale`, is above `threshold`. A smaller `scale` makes bigger veins, and a higher `threshold` makes rarer
ones. Each ore's noise is seeded with its id, so ores don't line up with each other.
Each mod's ores are a pass of their own, after the mods loaded before it. So a mod's ore can replace another mod's, like
`"replaces": "bworld:coal_ore"` for a rare vein inside coal. The base game's are in `mods/bworld/worldgen/ores.json`.
+15 -12
View File
@@ -267,21 +267,24 @@ What a solid block becomes, like Minecraft's surface rules: a rule gives a block
| `block` | `result_state: { Name }` | That block. |
| `biome_surface` | `part` | The column's biome's `top`, `filler`, `underwater_top` or `underwater_filler`. bworld's own. |
| Condition | Fields | Holds |
| --------------------------- | ---------- | ----------------------------------------------------------------------------------- |
| `stone_depth` | `offset` | When the solid blocks above it before air are at most `offset`. 0 is the top block. |
| `filler_depth` | | Within the biome's `filler_depth` below the top. bworld's own. |
| `above_preliminary_surface` | `offset` | At or above the preliminary surface plus `offset`. |
| `surface_underwater` | | When the column's ground is below `sea_level` - 1. bworld's own. |
| `steep` | | When the column is steep, see the noise settings' `steep`. |
| `bare_cliffs` | | When the biome's surface has `bare_cliffs`. bworld's own. |
| `y_at_least` | `function` | At or above the height a density function gives, like a snow line. bworld's own. |
| `biome` | `biome_is` | In one of the biomes. |
| `not` | `invert` | When `invert` doesn't. |
| Condition | Fields | Holds |
| --------------------------- | ---------------------- | ------------------------------------------------------------------------------------ |
| `stone_depth` | `offset` | When the solid blocks above it before air are at most `offset`. 0 is the top block. |
| `filler_depth` | | Within the biome's `filler_depth` below the top. bworld's own. |
| `above_preliminary_surface` | `offset` | At or above the preliminary surface plus `offset`. |
| `surface_underwater` | | When the column's ground is below `sea_level` - 1. bworld's own. |
| `steep` | | When the column is steep, see the noise settings' `steep`. |
| `bare_cliffs` | | When the biome's surface has `bare_cliffs`. bworld's own. |
| `y_at_least` | `function` | At or above the height a density function gives, like a snow line. bworld's own. |
| `density` | `function` and a range | Where a density function is in the range, like a noise picking a rock. bworld's own. |
| `biome` | `biome_is` | In one of the biomes. |
| `not` | `invert` | When `invert` doesn't. |
The base game's: within 20 blocks of the ground, the top block is the biome's underwater cover under water, snow (or
stone on cliffs) above the snow line, stone on bare cliffs, and the biome's `top` otherwise. Below it, the biome's
filler down to its `filler_depth`. Everything else is stone.
filler down to its `filler_depth`. Below that are three layers of rock that follow the ground: sedimentary down to 20
blocks below the preliminary surface, metamorphic down to 45, and igneous the rest of the way. In each layer, a noise of
its own (`bworld:overworld/sedimentary_rock` and so on) picks the rock, split evenly between the layer's rocks.
## Dimensions