parse the world

This commit is contained in:
adman
2026-04-21 22:24:12 +02:00
parent f6001c8b22
commit 895ec53698
2 changed files with 125 additions and 0 deletions
+22
View File
@@ -1,10 +1,13 @@
package anvil_test
import (
"encoding/json"
"fmt"
"os"
"testing"
"github.com/admin-else/strom/level/anvil"
"github.com/admin-else/strom/util"
)
func TestLevel(t *testing.T) {
@@ -20,3 +23,22 @@ func TestLevel(t *testing.T) {
}
t.Log(l)
}
func TestRegionFile(t *testing.T) {
f, err := os.Open("./testdata/testworld/region/r.0.0.mca")
if err != nil {
t.Fatal(err)
}
defer f.Close()
ch, err := anvil.ReadChunkHeader(f)
if err != nil {
t.Fatal(err)
}
n, err := ch.ChunkAt(f, 0, 0)
if err != nil {
return
}
fmt.Println(string(util.MustT(json.MarshalIndent(n, "", " "))))
}