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
30
internal/world/terrain_debug_test.go
Normal file
30
internal/world/terrain_debug_test.go
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
package world
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"testing"
|
||||
"regionio/internal/worldgen"
|
||||
)
|
||||
|
||||
func TestTerrainHeightProfile(t *testing.T) {
|
||||
d := worldgen.SimpleTerrain(0)
|
||||
minH, maxH := 1000, -1000
|
||||
// surface height along z=8 for x in [-32,32]
|
||||
line := ""
|
||||
for x := -32; x <= 32; x += 4 {
|
||||
top := MinY - 1
|
||||
for y := MinY; y < MinY+WorldHeight; y++ {
|
||||
if d.Compute(worldgen.FunctionContext{X: float64(x), Y: float64(y), Z: 8}) > 0 {
|
||||
top = y
|
||||
}
|
||||
}
|
||||
line += fmt.Sprintf("%d ", top)
|
||||
if top < minH { minH = top }
|
||||
if top > maxH { maxH = top }
|
||||
}
|
||||
t.Logf("surface heights (z=8): %s", line)
|
||||
t.Logf("min=%d max=%d range=%d", minH, maxH, maxH-minH)
|
||||
if minH < MinY || maxH > 120 {
|
||||
t.Fatalf("implausible terrain heights")
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue