diff options
author | hannibal2 <24389977+hannibal002@users.noreply.github.com> | 2024-08-16 11:17:02 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-16 11:17:02 +0200 |
commit | 24cbfa2faaa6cef709d42f75c3d1d51f3368e8b2 (patch) | |
tree | ae3d5f0b82def7214a3d51c0737183357878b671 /src/main/java/at/hannibal2/skyhanni/utils/ItemUtils.kt | |
parent | 571d0ed6eca959a18032509844d5237df6a9e601 (diff) | |
download | skyhanni-24cbfa2faaa6cef709d42f75c3d1d51f3368e8b2.tar.gz skyhanni-24cbfa2faaa6cef709d42f75c3d1d51f3368e8b2.tar.bz2 skyhanni-24cbfa2faaa6cef709d42f75c3d1d51f3368e8b2.zip |
Fix: Item Trackers NPC Price (#2352)
Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com>
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/utils/ItemUtils.kt')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/utils/ItemUtils.kt | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/ItemUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/ItemUtils.kt index cd55107db..59a718d6c 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/ItemUtils.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/ItemUtils.kt @@ -5,9 +5,9 @@ import at.hannibal2.skyhanni.events.DebugDataCollectEvent import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule import at.hannibal2.skyhanni.test.command.ErrorManager import at.hannibal2.skyhanni.utils.CollectionUtils.addOrPut +import at.hannibal2.skyhanni.utils.ItemPriceUtils.getPrice import at.hannibal2.skyhanni.utils.NEUInternalName.Companion.asInternalName import at.hannibal2.skyhanni.utils.NEUItems.getItemStackOrNull -import at.hannibal2.skyhanni.utils.NEUItems.getPrice import at.hannibal2.skyhanni.utils.NumberUtil.formatInt import at.hannibal2.skyhanni.utils.RegexUtils.matchMatcher import at.hannibal2.skyhanni.utils.RegexUtils.matches @@ -418,10 +418,12 @@ object ItemUtils { return neededItems } - fun getRecipePrice(recipe: NeuRecipe, pastRecipes: List<NeuRecipe> = emptyList()): Double = - neededItems(recipe).map { - it.key.getPrice(pastRecipes = pastRecipes) * it.value - }.sum() + fun NeuRecipe.getRecipePrice( + priceSource: ItemPriceSource = ItemPriceSource.BAZAAR_INSTANT_BUY, + pastRecipes: List<NeuRecipe> = emptyList(), + ): Double = neededItems(this).map { + it.key.getPrice(priceSource, pastRecipes) * it.value + }.sum() @SubscribeEvent fun onDebugDataCollect(event: DebugDataCollectEvent) { |