aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at
diff options
context:
space:
mode:
authorJ10a1n15 <45315647+j10a1n15@users.noreply.github.com>2024-05-02 11:05:46 +0200
committerGitHub <noreply@github.com>2024-05-02 11:05:46 +0200
commit74b7e95157f5f7ae2e05f245bd2ad74eb7f73cc0 (patch)
tree9d7612e2c70199f6f49464b3bd9fc9b3ef13f2bd /src/main/java/at
parent60948ae7f9b11f4c6e18c0defad2feccf5454486 (diff)
downloadskyhanni-74b7e95157f5f7ae2e05f245bd2ad74eb7f73cc0.tar.gz
skyhanni-74b7e95157f5f7ae2e05f245bd2ad74eb7f73cc0.tar.bz2
skyhanni-74b7e95157f5f7ae2e05f245bd2ad74eb7f73cc0.zip
Fix: Magical Power being always 0 (#1646)
Diffstat (limited to 'src/main/java/at')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/data/MaxwellAPI.kt6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/data/MaxwellAPI.kt b/src/main/java/at/hannibal2/skyhanni/data/MaxwellAPI.kt
index bea8bb294..2422b6f4e 100644
--- a/src/main/java/at/hannibal2/skyhanni/data/MaxwellAPI.kt
+++ b/src/main/java/at/hannibal2/skyhanni/data/MaxwellAPI.kt
@@ -245,6 +245,7 @@ object MaxwellAPI {
}
private fun processStack(stack: ItemStack) {
+ var foundMagicalPower = false
for (line in stack.getLore()) {
redstoneCollectionRequirementPattern.matchMatcher(line) {
ChatUtils.chat("Seems like you don't have the Requirement for the Accessory Bag yet, setting power to No Power and magical power to 0.")
@@ -261,7 +262,7 @@ object MaxwellAPI {
val mp = group("mp")
magicalPower = mp.formatInt()
- return@matchMatcher
+ foundMagicalPower = true
}
inventoryPowerPattern.matchMatcher(line) {
@@ -274,12 +275,11 @@ object MaxwellAPI {
"lore" to stack.getLore(),
noStackTrace = true
)
- return@matchMatcher
}
}
// If Magical Power isn't in the lore
- magicalPower = 0
+ if (!foundMagicalPower) magicalPower = 0
}
private fun getPowerByNameOrNull(name: String) = powers.find { it == name }