fix nbt: unexpected TAG_End error, which trigger by picking up an item without NBT.
This commit is contained in:
@ -2,6 +2,7 @@ package bot
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
|
|
||||||
@ -201,7 +202,7 @@ func handleSetSlotPacket(c *Client, p pk.Packet) error {
|
|||||||
slotI pk.Short
|
slotI pk.Short
|
||||||
slot entity.Slot
|
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
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user