fix: oversize container slots because minecraft is dumb

This commit is contained in:
əlemi 2022-07-03 16:54:40 +02:00
parent aa6f2b03bb
commit c2ea55c699
No known key found for this signature in database
GPG key ID: BBCBFE5D7244634E

View file

@ -63,7 +63,7 @@ class GameContainer(Scaffold):
self.window_title = packet.windowTitle self.window_title = packet.windowTitle
self.window_inventory_type = packet.inventoryType self.window_inventory_type = packet.inventoryType
self.window_entity_id = packet.entityId if packet.inventoryType == "EntityHorse" and hasattr(packet, "entityId") else None self.window_entity_id = packet.entityId if packet.inventoryType == "EntityHorse" and hasattr(packet, "entityId") else None
self.window_inventory = [None] * (packet.slotCount + 36) # add slots for player inventory self.window_inventory = [None] * ((packet.slotCount or 36) + 36) # add slots for player inventory
@self.on_packet(PacketSetSlot) @self.on_packet(PacketSetSlot)
async def on_set_slot(packet:PacketSetSlot): async def on_set_slot(packet:PacketSetSlot):