infer compress type before decode NBT fail
This commit is contained in:
16
save/playerdata.go
Normal file
16
save/playerdata.go
Normal 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
|
||||
}
|
Reference in New Issue
Block a user