pk.Ary and pk.Array using generic now

This commit is contained in:
Tnze
2022-03-20 01:17:25 +08:00
parent 7997a5faea
commit 4c2510565d
15 changed files with 95 additions and 155 deletions

View File

@ -7,7 +7,6 @@ import (
"errors"
"io"
"github.com/Tnze/go-mc/level/block"
"github.com/Tnze/go-mc/nbt"
)
@ -47,19 +46,6 @@ type BlockState struct {
Properties nbt.RawMessage
}
func (s *BlockState) Block() block.Block {
b, ok := block.FromID[s.Name]
if !ok {
return nil
}
if s.Properties.Type != nbt.TagEnd {
if err := s.Properties.Unmarshal(&b); err != nil {
return nil
}
}
return b
}
// Load read column data from []byte
func (c *Chunk) Load(data []byte) (err error) {
var r io.Reader = bytes.NewReader(data[1:])