diff options
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/utils/ItemUtils.kt | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/ItemUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/ItemUtils.kt index 3a60dd3f4..79b57fcf7 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/ItemUtils.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/ItemUtils.kt @@ -423,13 +423,15 @@ object ItemUtils { return neededItems } - // TODO remove debugs once stack overflow is found - fun getRecipePrice(recipe: NeuRecipe): Double { - println("getRecipePrice ${recipe.title}") - return neededItems(recipe).map { - println("ingredient: ${it.key}") - it.key.getPrice() * it.value + fun getRecipePrice(recipe: NeuRecipe): Double = + neededItems(recipe).map { + // prevents stack overflow errors with ENDERMAN_MONSTER + if (it.key.endsWith("_MONSTER")) { + 0.0 + } else { + it.key.getPrice() * it.value + } }.sum() - } + } |