From b9c99bdcfc107a460cbf250ff269d19b6a9c0722 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Sat, 2 Dec 2023 14:02:12 +0100 Subject: Updating Minion XP display when the minion picks up a new item while inside the inventory. --- src/main/java/at/hannibal2/skyhanni/events/MinionOpenEvent.kt | 2 +- .../java/at/hannibal2/skyhanni/features/minion/MinionFeatures.kt | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) (limited to 'src/main/java/at') 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) : LorenzEvent() -class MinionCloseEvent() : LorenzEvent() +class MinionCloseEvent : LorenzEvent() class MinionStorageOpenEvent(val position: LorenzVec?, val inventoryItems: Map) : 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 @@ -140,6 +141,13 @@ class MinionFeatures { minionStorageInventoryOpen = true } + @SubscribeEvent + fun onInventoryUpdated(event: InventoryUpdatedEvent) { + if (minionInventoryOpen) { + MinionOpenEvent(event.inventoryName, event.inventoryItems).postAndCatch() + } + } + @SubscribeEvent fun onMinionOpen(event: MinionOpenEvent) { val minions = minions ?: return -- cgit