aboutsummaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/events/MinionOpenEvent.kt2
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/minion/MinionFeatures.kt8
2 files changed, 9 insertions, 1 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/events/MinionOpenEvent.kt b/src/main/java/at/hannibal2/skyhanni/events/MinionOpenEvent.kt
index c6233371f..bfe8649ba 100644
--- a/src/main/java/at/hannibal2/skyhanni/events/MinionOpenEvent.kt
+++ b/src/main/java/at/hannibal2/skyhanni/events/MinionOpenEvent.kt
@@ -4,5 +4,5 @@ import at.hannibal2.skyhanni.utils.LorenzVec
import net.minecraft.item.ItemStack
class MinionOpenEvent(val inventoryName: String, val inventoryItems: Map<Int, ItemStack>) : LorenzEvent()
-class MinionCloseEvent() : LorenzEvent()
+class MinionCloseEvent : LorenzEvent()
class MinionStorageOpenEvent(val position: LorenzVec?, val inventoryItems: Map<Int, ItemStack>) : LorenzEvent()
diff --git a/src/main/java/at/hannibal2/skyhanni/features/minion/MinionFeatures.kt b/src/main/java/at/hannibal2/skyhanni/features/minion/MinionFeatures.kt
index 98d9c107e..5840475ce 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/minion/MinionFeatures.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/minion/MinionFeatures.kt
@@ -7,6 +7,7 @@ import at.hannibal2.skyhanni.data.IslandType
import at.hannibal2.skyhanni.data.ProfileStorageData
import at.hannibal2.skyhanni.events.InventoryCloseEvent
import at.hannibal2.skyhanni.events.InventoryFullyOpenedEvent
+import at.hannibal2.skyhanni.events.InventoryUpdatedEvent
import at.hannibal2.skyhanni.events.LorenzChatEvent
import at.hannibal2.skyhanni.events.LorenzRenderWorldEvent
import at.hannibal2.skyhanni.events.LorenzTickEvent
@@ -141,6 +142,13 @@ class MinionFeatures {
}
@SubscribeEvent
+ fun onInventoryUpdated(event: InventoryUpdatedEvent) {
+ if (minionInventoryOpen) {
+ MinionOpenEvent(event.inventoryName, event.inventoryItems).postAndCatch()
+ }
+ }
+
+ @SubscribeEvent
fun onMinionOpen(event: MinionOpenEvent) {
val minions = minions ?: return
val entity = lastClickedEntity ?: return