aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt b/src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt
index 4b334d027..75d394631 100644
--- a/src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt
+++ b/src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt
@@ -197,7 +197,10 @@ object NEUItems {
return getNpcPriceOrNull() ?: getRawCraftCostOrNull()
}
- fun NEUInternalName.getRawCraftCostOrNull(): Double? = manager.auctionManager.getCraftCost(asString())?.craftCost
+ // If NEU fails to calculate the craft costs, we calculate it ourself.
+ fun NEUInternalName.getRawCraftCostOrNull(): Double? = manager.auctionManager.getCraftCost(asString())?.craftCost ?: run {
+ getRecipes(this).map { ItemUtils.getRecipePrice(it) }.minOrNull()
+ }
fun NEUInternalName.getItemStackOrNull(): ItemStack? = ItemResolutionQuery(manager)
.withKnownInternalName(asString())