From 74b7e95157f5f7ae2e05f245bd2ad74eb7f73cc0 Mon Sep 17 00:00:00 2001 From: J10a1n15 <45315647+j10a1n15@users.noreply.github.com> Date: Thu, 2 May 2024 11:05:46 +0200 Subject: Fix: Magical Power being always 0 (#1646) --- src/main/java/at/hannibal2/skyhanni/data/MaxwellAPI.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/main/java/at') 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 } -- cgit