From c5327be0059d50333f43d78a5ebebba35db4de60 Mon Sep 17 00:00:00 2001 From: Thunderblade73 <85900443+Thunderblade73@users.noreply.github.com> Date: Sat, 18 May 2024 11:49:53 +0200 Subject: Fix: FF ioobe (#1823) Co-authored-by: Luna Co-authored-by: CalMWolfs <94038482+CalMWolfs@users.noreply.github.com> --- .../skyhanni/features/garden/FarmingFortuneDisplay.kt | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/main') diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/FarmingFortuneDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/FarmingFortuneDisplay.kt index 367ce5a55..db008f6b6 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/FarmingFortuneDisplay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/FarmingFortuneDisplay.kt @@ -16,6 +16,7 @@ import at.hannibal2.skyhanni.utils.CollectionUtils.nextAfter import at.hannibal2.skyhanni.utils.HypixelCommands import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName import at.hannibal2.skyhanni.utils.ItemUtils.getLore +import at.hannibal2.skyhanni.utils.LorenzUtils.groupOrNull import at.hannibal2.skyhanni.utils.LorenzUtils.round import at.hannibal2.skyhanni.utils.NEUInternalName import at.hannibal2.skyhanni.utils.NumberUtil.addSeparators @@ -52,8 +53,8 @@ object FarmingFortuneDisplay { "§7You have §6\\+(?\\d{1,3})☘ .*" ) private val tooltipFortunePattern by patternGroup.pattern( - "tooltip", - "^§7Farming Fortune: §a\\+([\\d.]+)(?: §2\\(\\+\\d\\))?(?: §9\\(\\+(\\d+)\\))?(?: §d\\(\\+(\\d+)\\))?\$" + "tooltip.new", + "^§7Farming Fortune: §a\\+(?[\\d.]+)(?: §2\\(\\+\\d\\))?(?: §9\\(\\+(?\\d+)\\))?(?: §d\\(\\+(?\\d+)\\))?\$" ) private val armorAbilityPattern by patternGroup.pattern( "armorability", @@ -63,6 +64,7 @@ object FarmingFortuneDisplay { "lotusability", "§7Piece Bonus: §6+(?.*)☘" ) + // todo make pattern work on Melon and Cropie armor private val armorAbilityFortunePattern by patternGroup.pattern( "armorabilityfortune", @@ -345,9 +347,9 @@ object FarmingFortuneDisplay { for (line in tool?.getLore()!!) { tooltipFortunePattern.matchMatcher(line) { - displayedFortune = group(1)!!.toDouble() - reforgeFortune = group(2)?.toDouble() ?: 0.0 - gemstoneFortune = group(3)?.toDouble() ?: 0.0 + displayedFortune = group("display")?.toDouble() ?: 0.0 + reforgeFortune = groupOrNull("reforge")?.toDouble() ?: 0.0 + gemstoneFortune = groupOrNull("gemstone")?.toDouble() ?: 0.0 } ?: continue itemBaseFortune = if (tool.getInternalName().contains("LOTUS")) { -- cgit