aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-02-16 20:54:35 +0100
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-02-16 20:54:35 +0100
commitae31ccc79c660c78684f6a4d4bb3b405c71cd3d6 (patch)
treed53b4a09f91cb83bdbf335e2058d72bd83e6e05e
parentdd3fdd9a70f7479c7a1481c890d2da14d8646ebb (diff)
downloadSkyHanni-ae31ccc79c660c78684f6a4d4bb3b405c71cd3d6.tar.gz
SkyHanni-ae31ccc79c660c78684f6a4d4bb3b405c71cd3d6.tar.bz2
SkyHanni-ae31ccc79c660c78684f6a4d4bb3b405c71cd3d6.zip
Fixed InventoryData.
-rw-r--r--src/main/java/at/hannibal2/skyhanni/data/InventoryData.kt4
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(