aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-05-18 13:16:35 +0200
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-05-18 13:16:35 +0200
commitaff2d8385126e7e3329ed894fb3728bde8f0a79b (patch)
tree12cb3a0c37b024389a5e8b739857316dd56268e7 /src/main/java/at/hannibal2/skyhanni
parent76d9ac63df01111c0f067fb9f50ebbbc8a8a7d41 (diff)
downloadskyhanni-aff2d8385126e7e3329ed894fb3728bde8f0a79b.tar.gz
skyhanni-aff2d8385126e7e3329ed894fb3728bde8f0a79b.tar.bz2
skyhanni-aff2d8385126e7e3329ed894fb3728bde8f0a79b.zip
Fixed Composter Overlay and Anita Medal Profit display stuck after exiting inventory via "close" item Fixed #116
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/data/OtherInventoryData.kt5
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/composter/ComposterOverlay.kt2
2 files changed, 6 insertions, 1 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/data/OtherInventoryData.kt b/src/main/java/at/hannibal2/skyhanni/data/OtherInventoryData.kt
index 580383e0c..3a018e33a 100644
--- a/src/main/java/at/hannibal2/skyhanni/data/OtherInventoryData.kt
+++ b/src/main/java/at/hannibal2/skyhanni/data/OtherInventoryData.kt
@@ -3,6 +3,7 @@ package at.hannibal2.skyhanni.data
import at.hannibal2.skyhanni.events.*
import net.minecraft.item.ItemStack
import net.minecraft.network.play.server.S2DPacketOpenWindow
+import net.minecraft.network.play.server.S2EPacketCloseWindow
import net.minecraft.network.play.server.S2FPacketSetSlot
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
import net.minecraftforge.fml.common.gameevent.TickEvent
@@ -37,6 +38,10 @@ class OtherInventoryData {
fun onChatPacket(event: PacketEvent.ReceiveEvent) {
val packet = event.packet
+ if (packet is S2EPacketCloseWindow) {
+ close()
+ }
+
if (packet is S2DPacketOpenWindow) {
val windowId = packet.windowId
val title = packet.windowTitle.unformattedText
diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/composter/ComposterOverlay.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/composter/ComposterOverlay.kt
index 7616ee323..241f6cbcd 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/garden/composter/ComposterOverlay.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/garden/composter/ComposterOverlay.kt
@@ -78,7 +78,7 @@ class ComposterOverlay {
var garden: GardenJson? = null
@SubscribeEvent
- fun onInventoryClose(event: GuiContainerEvent.CloseWindowEvent) {
+ fun onInventoryClose(event: InventoryCloseEvent) {
inInventory = false
}