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
commit11600a35dce6f8c5b0031a8318a60c42522a952b (patch)
treed53b4a09f91cb83bdbf335e2058d72bd83e6e05e
parent2eb0b472663f3e67cee98f3ef9de91a792b6f4cc (diff)
downloadskyhanni-11600a35dce6f8c5b0031a8318a60c42522a952b.tar.gz
skyhanni-11600a35dce6f8c5b0031a8318a60c42522a952b.tar.bz2
skyhanni-11600a35dce6f8c5b0031a8318a60c42522a952b.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(