aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-04-02 17:27:12 +0200
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-04-02 17:27:12 +0200
commitae4af78e29efb97d8898d6cf8d1e817357412bb0 (patch)
tree47258303140f8f3d85fa43326a506feb584ef534 /src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt
parentab8176beeadad04c4bc34ab57cdf66a459a076c3 (diff)
downloadskyhanni-ae4af78e29efb97d8898d6cf8d1e817357412bb0.tar.gz
skyhanni-ae4af78e29efb97d8898d6cf8d1e817357412bb0.tar.bz2
skyhanni-ae4af78e29efb97d8898d6cf8d1e817357412bb0.zip
Counting items in inventory and from minions to the bingo step helper collection goal display
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt33
1 files changed, 20 insertions, 13 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt b/src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt
index 85dc8816c..cf2515ac1 100644
--- a/src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt
+++ b/src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt
@@ -126,17 +126,17 @@ object NEUItems {
GlStateManager.popMatrix()
}
- fun getMultiplier(rawId: String, tryCount: Int = 0): Pair<String, Int> {
- if (multiplierCache.contains(rawId)) {
- return multiplierCache[rawId]!!
+ fun getMultiplier(internalName: String, tryCount: Int = 0): Pair<String, Int> {
+ if (multiplierCache.contains(internalName)) {
+ return multiplierCache[internalName]!!
}
if (tryCount == 10) {
- val message = "Error reading getMultiplier for item '$rawId'"
+ val message = "Error reading getMultiplier for item '$internalName'"
Error(message).printStackTrace()
LorenzUtils.error(message)
- return Pair(rawId, 1)
+ return Pair(internalName, 1)
}
- for (recipe in getRecipes(rawId)) {
+ for (recipe in getRecipes(internalName)) {
if (recipe !is CraftingRecipe) continue
val map = mutableMapOf<String, Int>()
@@ -144,26 +144,33 @@ object NEUItems {
val count = ingredient.count.toInt()
var internalItemId = ingredient.internalItemId
// ignore cactus green
- if (rawId == "ENCHANTED_CACTUS_GREEN") {
+ if (internalName == "ENCHANTED_CACTUS_GREEN") {
if (internalItemId == "INK_SACK-2") {
internalItemId = "CACTUS"
}
}
// ignore wheat in enchanted cookie
- if (rawId == "ENCHANTED_COOKIE") {
+ if (internalName == "ENCHANTED_COOKIE") {
if (internalItemId == "WHEAT") {
continue
}
}
// ignore golden carrot in enchanted golden carrot
- if (rawId == "ENCHANTED_GOLDEN_CARROT") {
+ if (internalName == "ENCHANTED_GOLDEN_CARROT") {
if (internalItemId == "GOLDEN_CARROT") {
continue
}
}
+ // ignore rabbit hide in leather
+ if (internalName == "LEATHER") {
+ if (internalItemId == "RABBIT_HIDE") {
+ continue
+ }
+ }
+
// println("")
// println("rawId: $rawId")
// println("internalItemId: $internalItemId")
@@ -177,15 +184,15 @@ object NEUItems {
return if (current.second > 1) {
val child = getMultiplier(id, tryCount + 1)
val result = Pair(child.first, child.second * current.second)
- multiplierCache[rawId] = result
+ multiplierCache[internalName] = result
result
} else {
- Pair(rawId, 1)
+ Pair(internalName, 1)
}
}
- val result = Pair(rawId, 1)
- multiplierCache[rawId] = result
+ val result = Pair(internalName, 1)
+ multiplierCache[internalName] = result
return result
}