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
27
internal/worldgen/loadtest_test.go
Normal file
27
internal/worldgen/loadtest_test.go
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
package worldgen
|
||||
|
||||
import (
|
||||
"math"
|
||||
"testing"
|
||||
)
|
||||
|
||||
// TestLoadOverworldDensity loads the full overworld final_density tree and
|
||||
// checks it evaluates to finite values with the expected vertical sign trend
|
||||
// (solid deep down, air high up).
|
||||
func TestLoadOverworldDensity(t *testing.T) {
|
||||
od, err := LoadOverworldFinalDensity(0)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
deep := od.Final.Compute(FunctionContext{X: 0, Y: -40, Z: 0})
|
||||
high := od.Final.Compute(FunctionContext{X: 0, Y: 200, Z: 0})
|
||||
if math.IsNaN(deep) || math.IsNaN(high) {
|
||||
t.Fatal("final_density produced NaN")
|
||||
}
|
||||
if !(deep > 0) {
|
||||
t.Fatalf("expected solid (positive) deep underground, got %v", deep)
|
||||
}
|
||||
if !(high < 0) {
|
||||
t.Fatalf("expected air (negative) high up, got %v", high)
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue