From 11600a35dce6f8c5b0031a8318a60c42522a952b Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Thu, 16 Feb 2023 20:54:35 +0100 Subject: Fixed InventoryData. --- src/main/java/at/hannibal2/skyhanni/data/InventoryData.kt | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/main/java') 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( -- cgit