fix nbt: unexpected TAG_End error, which trigger by picking up an item without NBT.

This commit is contained in:
Tnze
2020-03-04 11:53:16 +08:00
parent 5740edd409
commit e10bb44716

View File

@ -2,6 +2,7 @@ package bot
import (
"bytes"
"errors"
"fmt"
"io/ioutil"
@ -201,7 +202,7 @@ func handleSetSlotPacket(c *Client, p pk.Packet) error {
slotI pk.Short
slot entity.Slot
)
if err := p.Scan(&windowID, &slotI, &slot); err != nil && err != nbt.ErrEND {
if err := p.Scan(&windowID, &slotI, &slot); errors.Is(err, nbt.ErrEND) {
return err
}