infer compress type before decode NBT fail

This commit is contained in:
Tnze
2019-07-31 17:31:16 +08:00
parent 697e09fc5e
commit 5fbc95d4a0
19 changed files with 100 additions and 2 deletions

16
save/playerdata.go Normal file
View File

@ -0,0 +1,16 @@
package save
import (
"github.com/Tnze/go-mc/nbt"
"io"
)
type PlayerData struct {
Pos [3]float64
Motion [3]float64
}
func ReadPlayerData(r io.Reader) (data PlayerData, err error) {
err = nbt.NewDecoder(r).Decode(&data)
return
}