diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-12-02 00:30:18 +0100 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-12-02 00:30:18 +0100 |
commit | a11d12c0cc4202715ea4305f5bced886d6a7df4f (patch) | |
tree | a41332bf2063ae0364147e0fb28feb0db8e73812 /src/main/java/at/hannibal2/skyhanni | |
parent | 3a661521014be1ff856e08243f961f8745571eb2 (diff) | |
download | skyhanni-a11d12c0cc4202715ea4305f5bced886d6a7df4f.tar.gz skyhanni-a11d12c0cc4202715ea4305f5bced886d6a7df4f.tar.bz2 skyhanni-a11d12c0cc4202715ea4305f5bced886d6a7df4f.zip |
Renamed feature and using lastOrNull instead of last to avoid List is empty error.
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/config/features/inventory/InventoryConfig.java | 2 | ||||
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/inventory/ItemDisplayOverlayFeatures.kt | 12 |
2 files changed, 7 insertions, 7 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/inventory/InventoryConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/inventory/InventoryConfig.java index bc333cfb8..60cc0e405 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/inventory/InventoryConfig.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/inventory/InventoryConfig.java @@ -87,7 +87,7 @@ public class InventoryConfig { VACUUM_GARDEN("§bVacuum (Garden)", 14), BOTTLE_OF_JYRRE("§bBottle Of Jyrre", 15), EDITION_NUMBER("§bEdition Number", 16), - SECRET_BINGO_DISCOVERY("§bSecret Bingo Discovery"), + BINGO_GOAL_RANK("§bBingo Goal Rank"), ; private final String str; 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 f9008713d..5f611a587 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/ItemDisplayOverlayFeatures.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/ItemDisplayOverlayFeatures.kt @@ -4,6 +4,7 @@ import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.api.CollectionAPI import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator import at.hannibal2.skyhanni.config.features.inventory.InventoryConfig.ItemNumberEntry +import at.hannibal2.skyhanni.config.features.inventory.InventoryConfig.ItemNumberEntry.BINGO_GOAL_RANK import at.hannibal2.skyhanni.config.features.inventory.InventoryConfig.ItemNumberEntry.BOTTLE_OF_JYRRE import at.hannibal2.skyhanni.config.features.inventory.InventoryConfig.ItemNumberEntry.COLLECTION_LEVEL import at.hannibal2.skyhanni.config.features.inventory.InventoryConfig.ItemNumberEntry.DUNGEON_HEAD_FLOOR_NUMBER @@ -19,7 +20,6 @@ import at.hannibal2.skyhanni.config.features.inventory.InventoryConfig.ItemNumbe import at.hannibal2.skyhanni.config.features.inventory.InventoryConfig.ItemNumberEntry.RANCHERS_BOOTS_SPEED import at.hannibal2.skyhanni.config.features.inventory.InventoryConfig.ItemNumberEntry.SKILL_LEVEL import at.hannibal2.skyhanni.config.features.inventory.InventoryConfig.ItemNumberEntry.VACUUM_GARDEN -import at.hannibal2.skyhanni.config.features.inventory.InventoryConfig.ItemNumberEntry.SECRET_BINGO_DISCOVERY import at.hannibal2.skyhanni.events.RenderItemTipEvent import at.hannibal2.skyhanni.features.garden.pests.PestAPI import at.hannibal2.skyhanni.utils.ConfigUtils @@ -52,7 +52,7 @@ object ItemDisplayOverlayFeatures { private val gardenVacuumPatterm = "§7Vacuum Bag: §6(?<amount>\\d*) Pests?".toPattern() private val harvestPattern = "§7§7You may harvest §6(?<amount>.).*".toPattern() private val dungeonPotionPattern = "Dungeon (?<level>.*) Potion".toPattern() - private val secretBingoDiscoveryPattern = "(§.)*You were the (§.)*(?<nth>[\\w]+)(?<ordinal>(st|nd|rd|th)) (§.)*to".toPattern() + private val bingoGoalRankPattern = "(§.)*You were the (§.)*(?<rank>[\\w]+)(?<ordinal>(st|nd|rd|th)) (§.)*to".toPattern() private val bottleOfJyrre = "NEW_BOTTLE_OF_JYRRE".asInternalName() @@ -224,11 +224,11 @@ object ItemDisplayOverlayFeatures { } } - if (SECRET_BINGO_DISCOVERY.isSelected() && chestName == "Bingo Card" && item.getLore().last() == "§aGOAL REACHED") { + if (BINGO_GOAL_RANK.isSelected() && chestName == "Bingo Card" && item.getLore().lastOrNull() == "§aGOAL REACHED") { for (line in item.getLore()) { - secretBingoDiscoveryPattern.matchMatcher(line) { - val nth = group("nth").formatNumber() - if (nth < 10000) return "${NumberUtil.format(nth)}" + bingoGoalRankPattern.matchMatcher(line) { + val rank = group("rank").formatNumber() + if (rank < 10000) return "§6${NumberUtil.format(rank)}" } } } |