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/features/bingo | |
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/features/bingo')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/bingo/MinionCraftHelper.kt | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/bingo/MinionCraftHelper.kt b/src/main/java/at/hannibal2/skyhanni/features/bingo/MinionCraftHelper.kt index dbec4ea57..6f7a062f8 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/bingo/MinionCraftHelper.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/bingo/MinionCraftHelper.kt @@ -7,6 +7,7 @@ import at.hannibal2.skyhanni.events.InventoryFullyOpenedEvent import at.hannibal2.skyhanni.events.LorenzTickEvent import at.hannibal2.skyhanni.events.LorenzWorldChangeEvent import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule +import at.hannibal2.skyhanni.utils.CollectionUtils.addOrPut import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName import at.hannibal2.skyhanni.utils.ItemUtils.hasEnchantments import at.hannibal2.skyhanni.utils.ItemUtils.itemName @@ -18,6 +19,7 @@ import at.hannibal2.skyhanni.utils.NEUItems import at.hannibal2.skyhanni.utils.NEUItems.getCachedIngredients import at.hannibal2.skyhanni.utils.NumberUtil.addSeparators import at.hannibal2.skyhanni.utils.NumberUtil.romanToDecimalIfNecessary +import at.hannibal2.skyhanni.utils.PrimitiveIngredient.Companion.toPrimitiveItemStacks import at.hannibal2.skyhanni.utils.RegexUtils.matchMatcher import at.hannibal2.skyhanni.utils.RenderUtils.renderStrings import at.hannibal2.skyhanni.utils.StringUtils.removeColor @@ -197,12 +199,9 @@ object MinionCraftHelper { val output = recipe.output ?: continue if (!output.internalName.contains("_GENERATOR_")) continue val map = mutableMapOf<NEUInternalName, Int>() - for (input in recipe.ingredients) { - val itemId = input.internalName + for ((itemId, count) in recipe.ingredients.toPrimitiveItemStacks()) { if (minionId != itemId) { - val count = input.count.toInt() - val old = map.getOrDefault(itemId, 0) - map[itemId] = old + count + map.addOrPut(itemId, count) } } var allDone = true |