load dimension example

This commit is contained in:
Tnze
2022-05-27 00:59:18 +08:00
parent 474d6a229b
commit 691e507fcf
3 changed files with 18 additions and 3 deletions

View File

@ -4,6 +4,7 @@ import (
"context"
_ "embed"
"flag"
"github.com/Tnze/go-mc/server/ecs"
"github.com/Tnze/go-mc/server/world"
"image"
_ "image/png"
@ -57,7 +58,11 @@ func main() {
keepAlive,
commands,
)
world.NewDimensionManager(game)
ecs.Register[world.Dimension, *ecs.HashMapStorage[world.Dimension]](game.World)
dimList := world.NewDimensionManager(game)
dimList.Add(game.CreateEntity(world.NewDimension(
"minecraft:overworld", *regionPath,
)), "minecraft:overworld")
player.SpawnSystem(game, "./save/testdata/playerdata")
player.PosAndRotSystem(game)
go game.Run(context.Background())