diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-12-02 14:02:12 +0100 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-12-02 14:02:12 +0100 |
commit | b9c99bdcfc107a460cbf250ff269d19b6a9c0722 (patch) | |
tree | da5b85091a1b12a28d7dbcf97e53f9ee55d2c6c3 /src/main/java | |
parent | 0de297133be4233e61beab835e98c98584371fe7 (diff) | |
download | skyhanni-b9c99bdcfc107a460cbf250ff269d19b6a9c0722.tar.gz skyhanni-b9c99bdcfc107a460cbf250ff269d19b6a9c0722.tar.bz2 skyhanni-b9c99bdcfc107a460cbf250ff269d19b6a9c0722.zip |
Updating Minion XP display when the minion picks up a new item while inside the inventory.
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/events/MinionOpenEvent.kt | 2 | ||||
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/minion/MinionFeatures.kt | 8 |
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 |