diff options
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorSupercraft.kt | 5 | ||||
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt | 4 |
2 files changed, 6 insertions, 3 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorSupercraft.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorSupercraft.kt index ba5706f1d..33643a172 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorSupercraft.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorSupercraft.kt @@ -10,6 +10,7 @@ import at.hannibal2.skyhanni.utils.ItemUtils.itemName import at.hannibal2.skyhanni.utils.NEUInternalName import at.hannibal2.skyhanni.utils.NEUInternalName.Companion.asInternalName import at.hannibal2.skyhanni.utils.NEUItems +import at.hannibal2.skyhanni.utils.NEUItems.allIngredients import at.hannibal2.skyhanni.utils.NEUItems.getItemStack import at.hannibal2.skyhanni.utils.SimpleTimeMark import at.hannibal2.skyhanni.utils.StringUtils.removeColor @@ -71,8 +72,8 @@ class GardenVisitorSupercraft { private fun getSupercraftForSacks(internalName: NEUInternalName, amount: Int) { val ingredients = NEUItems.getRecipes(internalName) // TODO describe what this line does - .first { !it.ingredients.first().internalItemId.contains("PEST") } - .ingredients + .firstOrNull() { !it.allIngredients().first().internalItemId.contains("PEST") } + ?.allIngredients() ?: return val ingredientReqs = mutableMapOf<String, Int>() for (ingredient in ingredients) { val key = ingredient.internalItemId diff --git a/src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt b/src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt index f379ea2f2..0324efcbb 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt @@ -322,7 +322,7 @@ object NEUItems { } } - fun NeuRecipe.getCachedIngredients() = ingredientsCache.getOrPut(this) { ingredients } + fun NeuRecipe.getCachedIngredients() = ingredientsCache.getOrPut(this) { allIngredients() } fun neuHasFocus(): Boolean { if (AuctionSearchOverlay.shouldReplace()) return true @@ -349,4 +349,6 @@ object NEUItems { val jsonObject = ConfigManager.gson.fromJson(jsonString, JsonObject::class.java) return manager.jsonToStack(jsonObject, false) } + + fun NeuRecipe.allIngredients(): Set<Ingredient> = ingredients } |