diff options
author | Thunderblade73 <85900443+Thunderblade73@users.noreply.github.com> | 2024-02-17 00:45:13 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-17 10:45:13 +1100 |
commit | 128b8db7ad7e8633af231d6f547aca1eed3c1e95 (patch) | |
tree | 379ec14dc52500bfca77c5c1bee82dd65b059013 /src/main/java/at/hannibal2/skyhanni/features | |
parent | e4854980b5dad328a524393286329c9f4d7e5095 (diff) | |
download | skyhanni-128b8db7ad7e8633af231d6f547aca1eed3c1e95.tar.gz skyhanni-128b8db7ad7e8633af231d6f547aca1eed3c1e95.tar.bz2 skyhanni-128b8db7ad7e8633af231d6f547aca1eed3c1e95.zip |
Fix: Pet Level pattern and stack size (#1018)
* Fix: Pet Level pattern and stack size
* removed empty line
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/inventory/ItemDisplayOverlayFeatures.kt | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/ItemDisplayOverlayFeatures.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/ItemDisplayOverlayFeatures.kt index d768bb844..75a4063a2 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/ItemDisplayOverlayFeatures.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/ItemDisplayOverlayFeatures.kt @@ -25,10 +25,12 @@ import at.hannibal2.skyhanni.events.RenderItemTipEvent import at.hannibal2.skyhanni.features.garden.pests.PestAPI import at.hannibal2.skyhanni.utils.ConfigUtils import at.hannibal2.skyhanni.utils.InventoryUtils +import at.hannibal2.skyhanni.utils.ItemCategory import at.hannibal2.skyhanni.utils.ItemUtils import at.hannibal2.skyhanni.utils.ItemUtils.cleanName import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName import at.hannibal2.skyhanni.utils.ItemUtils.getInternalNameOrNull +import at.hannibal2.skyhanni.utils.ItemUtils.getItemCategoryOrNull import at.hannibal2.skyhanni.utils.ItemUtils.getLore import at.hannibal2.skyhanni.utils.ItemUtils.name import at.hannibal2.skyhanni.utils.LorenzUtils.between @@ -39,6 +41,7 @@ import at.hannibal2.skyhanni.utils.NumberUtil.romanToDecimal import at.hannibal2.skyhanni.utils.NumberUtil.romanToDecimalIfNecessary import at.hannibal2.skyhanni.utils.SkyBlockItemModifierUtils.getBottleOfJyrreSeconds import at.hannibal2.skyhanni.utils.SkyBlockItemModifierUtils.getEdition +import at.hannibal2.skyhanni.utils.SkyBlockItemModifierUtils.getPetLevel import at.hannibal2.skyhanni.utils.SkyBlockItemModifierUtils.getRanchersSpeed import at.hannibal2.skyhanni.utils.StringUtils.matchMatcher import at.hannibal2.skyhanni.utils.StringUtils.removeColor @@ -120,15 +123,10 @@ object ItemDisplayOverlayFeatures { } if (PET_LEVEL.isSelected()) { - val containerName = InventoryUtils.openInventoryName() - if (!containerName.endsWith("Sea Creature Guide") && ItemUtils.isPet(itemName)) { - petLevelPattern.matchMatcher(itemName) { - val rawLevel = group("level") - val level = rawLevel.toIntOrNull() - ?: throw IllegalStateException("pet level not found for item name '$itemName'") - if (level != ItemUtils.maxPetLevel(itemName)) { - return "$level" - } + if (item.getItemCategoryOrNull() == ItemCategory.PET) { + val level = item.getPetLevel() + if (level != ItemUtils.maxPetLevel(itemName)) { + return level.toString() } } } |