aboutsummaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-06-04 23:23:07 +0200
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-06-04 23:23:07 +0200
commit644291019d9033eba9358791b4f771258d4f1163 (patch)
treed0840490e27815b460561cec37b34142cc972988 /src/main/java
parenta0d813a371016bd1428bb7753edff453b6ef4eb4 (diff)
downloadskyhanni-644291019d9033eba9358791b4f771258d4f1163.tar.gz
skyhanni-644291019d9033eba9358791b4f771258d4f1163.tar.bz2
skyhanni-644291019d9033eba9358791b4f771258d4f1163.zip
Properly sending inventory close event when closing the gui position editor
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt2
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/core/config/gui/GuiPositionEditor.kt2
-rw-r--r--src/main/java/at/hannibal2/skyhanni/data/OtherInventoryData.kt4
3 files changed, 5 insertions, 3 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt
index 4386d81b5..05b2d0cdb 100644
--- a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt
+++ b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt
@@ -121,7 +121,7 @@ class SkyHanniMod {
loadModule(ItemTipHelper())
loadModule(RenderLivingEntityHelper())
loadModule(SkillExperience())
- loadModule(OtherInventoryData())
+ loadModule(OtherInventoryData)
loadModule(TabListData())
loadModule(RenderGuiData())
loadModule(GardenCropMilestones())
diff --git a/src/main/java/at/hannibal2/skyhanni/config/core/config/gui/GuiPositionEditor.kt b/src/main/java/at/hannibal2/skyhanni/config/core/config/gui/GuiPositionEditor.kt
index 0044ed6ea..8ff09bba5 100644
--- a/src/main/java/at/hannibal2/skyhanni/config/core/config/gui/GuiPositionEditor.kt
+++ b/src/main/java/at/hannibal2/skyhanni/config/core/config/gui/GuiPositionEditor.kt
@@ -22,6 +22,7 @@ import at.hannibal2.skyhanni.config.core.config.Position
import at.hannibal2.skyhanni.data.GuiEditManager.Companion.getAbsX
import at.hannibal2.skyhanni.data.GuiEditManager.Companion.getAbsY
import at.hannibal2.skyhanni.data.GuiEditManager.Companion.getDummySize
+import at.hannibal2.skyhanni.data.OtherInventoryData
import at.hannibal2.skyhanni.utils.GuiRenderUtils
import at.hannibal2.skyhanni.utils.LorenzUtils
import net.minecraft.client.Minecraft
@@ -40,6 +41,7 @@ class GuiPositionEditor(private val positions: List<Position>, private val borde
override fun onGuiClosed() {
super.onGuiClosed()
clickedPos = -1
+ OtherInventoryData.close()
}
override fun drawScreen(unusedX: Int, unusedY: Int, partialTicks: Float) {
diff --git a/src/main/java/at/hannibal2/skyhanni/data/OtherInventoryData.kt b/src/main/java/at/hannibal2/skyhanni/data/OtherInventoryData.kt
index 3a018e33a..f1cebf640 100644
--- a/src/main/java/at/hannibal2/skyhanni/data/OtherInventoryData.kt
+++ b/src/main/java/at/hannibal2/skyhanni/data/OtherInventoryData.kt
@@ -8,7 +8,7 @@ import net.minecraft.network.play.server.S2FPacketSetSlot
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
import net.minecraftforge.fml.common.gameevent.TickEvent
-class OtherInventoryData {
+object OtherInventoryData {
private var currentInventory: Inventory? = null
private var acceptItems = false
private var lateEvent: LateInventoryOpenEvent? = null
@@ -18,7 +18,7 @@ class OtherInventoryData {
close()
}
- private fun close() {
+ fun close() {
currentInventory?.let {
InventoryCloseEvent(it).postAndCatch()
currentInventory = null