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/blendedcompute_test.go
Normal file
16
internal/worldgen/blendedcompute_test.go
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
package worldgen
|
||||
import ("math";"testing")
|
||||
func TestBlendedCompute(t *testing.T){
|
||||
bn:=NewBlendedNoise(NewXoroshiro(42),0.25,0.125,80.0,160.0,8.0)
|
||||
cases:=[]struct{x,y,z float64;want float64}{
|
||||
{0,64,0,-0.012282880040235755},
|
||||
{100,40,-200,0.007126388725845459},
|
||||
{1234,80,-5678,-0.13408933571823986},
|
||||
{-37,128,99,-0.0932958728408956},
|
||||
{8,200,8,0.0075622598474688885},
|
||||
}
|
||||
for _,c:=range cases{
|
||||
got:=bn.Compute(FunctionContext{X:c.x,Y:c.y,Z:c.z})
|
||||
if math.Abs(got-c.want)>1e-12 { t.Fatalf("bn(%v,%v,%v)=%v want %v (diff %v)",c.x,c.y,c.z,got,c.want,got-c.want) }
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue