Initial commit: RegionIO Minecraft server core (26.1.2/protocol 775)
Vanilla-faithful overworld generator (final_density + multi-noise biomes), full connection lifecycle (status/login/configuration/play), chunk streaming, creative block editing, and the protocol/nbt/registry infrastructure.
This commit is contained in:
commit
a7bb9496ae
146 changed files with 217621 additions and 0 deletions
16
internal/worldgen/simple.go
Normal file
16
internal/worldgen/simple.go
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
package worldgen
|
||||
|
||||
// SimpleTerrain builds a small density-function tree producing gentle 3D hills,
|
||||
// using the verified noise primitives. It is a placeholder shaped by hand until
|
||||
// the full vanilla overworld density tree is ported.
|
||||
//
|
||||
// density(x,y,z) = yBias(y) + amplitude * noise3D(scaled x,y,z)
|
||||
//
|
||||
// yBias goes from +1 at fromY to -1 at toY (clamped), so the surface sits where
|
||||
// the noise crosses the bias — roughly midway, perturbed by the noise.
|
||||
func SimpleTerrain(seed int64) DensityFunction {
|
||||
noise := NewNormalNoise(NewXoroshiro(seed), -4, []float64{1, 1, 1, 1})
|
||||
bias := YClampedGradient{FromY: 40, ToY: 104, FromV: 1.0, ToV: -1.0}
|
||||
perturb := Mul(Constant(0.7), NoiseDF{Noise: noise, XZScale: 0.2, YScale: 0.1})
|
||||
return Add(bias, perturb)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue