Fix some warnings and typos

This commit is contained in:
Tnze
2021-02-18 14:07:30 +08:00
parent 750f87e780
commit bc9cd93066
23 changed files with 102 additions and 86 deletions

View File

@ -84,9 +84,13 @@ func (s Slot) Encode() []byte {
b.Write(pk.Byte(s.Count).Encode())
if s.NBT != nil {
nbt.NewEncoder(&b).Encode(s.NBT)
if err := nbt.NewEncoder(&b).Encode(s.NBT); err != nil {
panic(err)
}
} else {
b.Write([]byte{nbt.TagEnd})
if _, err := b.Write([]byte{nbt.TagEnd}); err != nil {
panic(err)
}
}
return b.Bytes()