fix: maybe I'm supposed to close containers when I receive windowId < 0 ?

This commit is contained in:
əlemi 2022-07-03 17:09:05 +02:00
parent c2ea55c699
commit acdb60cd2f
No known key found for this signature in database
GPG key ID: BBCBFE5D7244634E

View file

@ -67,5 +67,9 @@ class GameContainer(Scaffold):
@self.on_packet(PacketSetSlot) @self.on_packet(PacketSetSlot)
async def on_set_slot(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 self.window_inventory[packet.slot] = packet.item