From acdb60cd2f668967841d911a36a0d5d07ba531d0 Mon Sep 17 00:00:00 2001 From: alemidev Date: Sun, 3 Jul 2022 17:09:05 +0200 Subject: [PATCH] fix: maybe I'm supposed to close containers when I receive windowId < 0 ? --- src/treepuncher/game/container.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/treepuncher/game/container.py b/src/treepuncher/game/container.py index 4ebef0d..449b9a6 100644 --- a/src/treepuncher/game/container.py +++ b/src/treepuncher/game/container.py @@ -67,5 +67,9 @@ class GameContainer(Scaffold): @self.on_packet(PacketSetSlot) async def on_set_slot(packet:PacketSetSlot): - if self.window_id > 0 and packet.windowId == self.window_id: + if packet.windowId < 0: + self.window_entity_id = 0 + self.window_id = 0 + self.window_title = "" + elif self.window_id > 0 and packet.windowId == self.window_id: self.window_inventory[packet.slot] = packet.item