diff options
author | hannibal2 <24389977+hannibal002@users.noreply.github.com> | 2024-09-24 10:27:50 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-24 10:27:50 +0200 |
commit | 1e9764d1d1209177d4a939a9b812931a7d49a926 (patch) | |
tree | b903d47fb7f4f23db60211a29419a06863982dd5 /src/main/java/at/hannibal2/skyhanni/utils/ItemUtils.kt | |
parent | 04d2530a67ef9ae2b877a448e15ce16fadd4c25b (diff) | |
download | skyhanni-1e9764d1d1209177d4a939a9b812931a7d49a926.tar.gz skyhanni-1e9764d1d1209177d4a939a9b812931a7d49a926.tar.bz2 skyhanni-1e9764d1d1209177d4a939a9b812931a7d49a926.zip |
Backend: PrimitiveIngredient changes and code cleanup (#2576)
Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com>
Co-authored-by: Cal <cwolfson58@gmail.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 | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/ItemUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/ItemUtils.kt index add66cc0a..d39b37c8a 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/ItemUtils.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/ItemUtils.kt @@ -9,6 +9,7 @@ import at.hannibal2.skyhanni.utils.CollectionUtils.addOrPut import at.hannibal2.skyhanni.utils.ItemPriceUtils.getPrice import at.hannibal2.skyhanni.utils.NEUItems.getItemStackOrNull import at.hannibal2.skyhanni.utils.NumberUtil.formatInt +import at.hannibal2.skyhanni.utils.PrimitiveIngredient.Companion.toPrimitiveItemStacks import at.hannibal2.skyhanni.utils.RegexUtils.matchMatcher import at.hannibal2.skyhanni.utils.RegexUtils.matches import at.hannibal2.skyhanni.utils.SkyBlockItemModifierUtils.cachedData @@ -511,9 +512,7 @@ object ItemUtils { fun neededItems(recipe: PrimitiveRecipe): Map<NEUInternalName, Int> { val neededItems = mutableMapOf<NEUInternalName, Int>() - for (ingredient in recipe.ingredients) { - val material = ingredient.internalName - val amount = ingredient.count.toInt() + for ((material, amount) in recipe.ingredients.toPrimitiveItemStacks()) { neededItems.addOrPut(material, amount) } return neededItems |