dragonfly
dragonfly copied to clipboard
Cannot set world spawn to Y>127 or Y<0 on default world
How to reproduce:
func main() {
slog.SetLogLoggerLevel(slog.LevelDebug)
chat.Global.Subscribe(chat.StdoutSubscriber{})
conf, err := readConfig(slog.Default())
if err != nil {
panic(err)
}
srv := conf.New()
srv.CloseOnProgramEnd()
srv.World().SetSpawn(cube.Pos{0, 208, 0})
time.Sleep(time.Second*2)
fmt.Printf("Spawn: %v\n", srv.World().Spawn()) // magically changed
srv.Listen()
for p := range srv.Accept() {
_ = p
}
}
Causes
- WorldProvider and WorldSettings are shared across all three worlds (
srv.World(),srv.Nether(), andsrv.End()). So, if the spawn position is invalid in any dimension, it will automatically correct itself during a tick.
maybe we could avoid such behavior by ignoring other dimensions, cause nether does not really have spawn point (so we can just return 0 0 0) and the end dimension spawn is always 100 50 0