diff options
Diffstat (limited to 'src')
3 files changed, 7 insertions, 4 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/events/MinionOpenEvent.kt b/src/main/java/at/hannibal2/skyhanni/events/MinionOpenEvent.kt index 4cbb112de..c6233371f 100644 --- a/src/main/java/at/hannibal2/skyhanni/events/MinionOpenEvent.kt +++ b/src/main/java/at/hannibal2/skyhanni/events/MinionOpenEvent.kt @@ -4,4 +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 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 77ce80990..98d9c107e 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/minion/MinionFeatures.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/minion/MinionFeatures.kt @@ -11,6 +11,7 @@ import at.hannibal2.skyhanni.events.LorenzChatEvent import at.hannibal2.skyhanni.events.LorenzRenderWorldEvent import at.hannibal2.skyhanni.events.LorenzTickEvent import at.hannibal2.skyhanni.events.LorenzWorldChangeEvent +import at.hannibal2.skyhanni.events.MinionCloseEvent import at.hannibal2.skyhanni.events.MinionOpenEvent import at.hannibal2.skyhanni.events.MinionStorageOpenEvent import at.hannibal2.skyhanni.test.GriffinUtils.drawWaypointFilled @@ -180,6 +181,7 @@ class MinionFeatures { if (location !in minions) { minions[location]!!.lastClicked = 0 } + MinionCloseEvent().postAndCatch() } @SubscribeEvent diff --git a/src/main/java/at/hannibal2/skyhanni/features/minion/MinionXp.kt b/src/main/java/at/hannibal2/skyhanni/features/minion/MinionXp.kt index 110413323..787cbe059 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/minion/MinionXp.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/minion/MinionXp.kt @@ -2,8 +2,8 @@ package at.hannibal2.skyhanni.features.minion import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.data.jsonobjects.repo.MinionXPJson -import at.hannibal2.skyhanni.events.InventoryCloseEvent import at.hannibal2.skyhanni.events.IslandChangeEvent +import at.hannibal2.skyhanni.events.MinionCloseEvent import at.hannibal2.skyhanni.events.MinionOpenEvent import at.hannibal2.skyhanni.events.MinionStorageOpenEvent import at.hannibal2.skyhanni.events.RepositoryReloadEvent @@ -83,7 +83,7 @@ class MinionXp { private fun getStorageXpAndUpdateTotal( minionPosition: LorenzVec, - xpTotal: EnumMap<XpType, Double> + xpTotal: EnumMap<XpType, Double>, ): Boolean { if (!getHasStorage(minionPosition)) return false val storage = minionStorages.firstOrNull { @@ -110,7 +110,7 @@ class MinionXp { val name = item.name val xp = xpInfoMap[name] ?: return@forEach - //TODO add wisdom and Derpy to calculation and random extra Exp Events + // TODO add wisdom and Derpy to calculation and random extra Exp Events val xpAmount = xp.amount * item.stackSize xpItemMap[item] = collectMessage(xp.type, xpAmount) @@ -181,7 +181,7 @@ class MinionXp { } @SubscribeEvent - fun onInventoryClose(event: InventoryCloseEvent) { + fun onMinionClose(event: MinionCloseEvent) { xpItemMap.clear() collectItemXpList.clear() } |