diff options
Diffstat (limited to 'src/main/java/at/hannibal2')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/data/InventoryData.kt | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/data/InventoryData.kt b/src/main/java/at/hannibal2/skyhanni/data/InventoryData.kt index 3495f2177..0f372269a 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/InventoryData.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/InventoryData.kt @@ -11,6 +11,7 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent class InventoryData { private var currentInventory: Inventory? = null + private var acceptItems = false @SubscribeEvent fun onCloseWindow(event: GuiContainerEvent.CloseWindowEvent) { @@ -35,9 +36,11 @@ class InventoryData { close() currentInventory = Inventory(windowId, title, slotCount) + acceptItems = true } if (packet is S2FPacketSetSlot) { + if (!acceptItems) return currentInventory?.let { if (it.windowId != packet.func_149175_c()) return @@ -61,6 +64,7 @@ class InventoryData { private fun done(inventory: Inventory) { InventoryOpenEvent(inventory).postAndCatch() + acceptItems = false } class Inventory( |