Ore veins from the noise router

The router has carried vein_toggle, vein_ridged and vein_gap since the whole of
it was parsed, and nothing read them. So the copper and iron mega-veins -- the
long branching sheets that run through the deepslate and the copper band, not
the small scattered ore blobs -- did not exist.

OreVeinifier is not a decoration feature. It is the second entry of the same
MaterialRuleList the aquifer heads: the aquifer answers first, and only where it
says the position is solid rock does the veinifier get a turn at what would
otherwise be plain stone. That is why a vein never opens into a cave, and it is
why this lands in the density pass rather than in decorate.

Three random draws per position, in a fixed order, from a factory hashed off
"minecraft:ore": solidness, then richness, then the rare raw-ore block.
Reordering them or hoisting the vein_gap compute above the second draw would
change every vein in the world, so the code follows the bytecode's order rather
than the one that reads better.

The Y windows are the sharp edge worth knowing about: a vein's type comes from
the sign of the veininess noise, but its window comes from the type, so
veininess <= 0 anywhere outside -60..-8 is simply not a vein. Over 49 sampled
chunks copper lands in 0..49 and iron in -57..-8, and raw ore comes out at 1.9%
of ore blocks against vanilla's 2%.
This commit is contained in:
Master290 2026-07-27 03:48:48 +03:00
parent e0fdddd887
commit 0f76058db6
5 changed files with 220 additions and 15 deletions

View file

@ -50,8 +50,10 @@ type OverworldDensity struct {
AquifersEnabled bool
OreVeinsEnabled bool
// AquiferRandom places the aquifer cell centres.
// AquiferRandom places the aquifer cell centres; OreRandom rolls the
// per-position ore-vein draws.
AquiferRandom PositionalRandomFactory
OreRandom PositionalRandomFactory
// Surface samples the noises SurfaceSystem reads per column, before the
// rule tree runs.
@ -103,6 +105,7 @@ func LoadOverworldFinalDensity(seed int64) (*OverworldDensity, error) {
AquifersEnabled: settings.AquifersEnabled,
OreVeinsEnabled: settings.OreVeinsEnabled,
AquiferRandom: l.rs.AquiferRandom(),
OreRandom: l.rs.OreRandom(),
prelim: newLevelCache(),
}