diff --git a/src/main/java/at/hannibal2/skyhanni/utils/ItemUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/ItemUtils.kt index 3a60dd3f4441..79b57fcf7d6a 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() - } + }