From e10bb4471655b0bd75e3abdfa6678a5ca28d3b2d Mon Sep 17 00:00:00 2001 From: Tnze Date: Wed, 4 Mar 2020 11:53:16 +0800 Subject: [PATCH] fix nbt: unexpected TAG_End error, which trigger by picking up an item without NBT. --- bot/ingame.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bot/ingame.go b/bot/ingame.go index a8742a4..cc1a3b2 100644 --- a/bot/ingame.go +++ b/bot/ingame.go @@ -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 }