pk.Ary and pk.Array using generic now
This commit is contained in:
@ -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:])
|
||||
|
Reference in New Issue
Block a user