From 4f8e40e3b95a6839d660bace2f2cd04d2db2a101 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Sat, 6 Jan 2024 11:23:22 +0100 Subject: Using function isOwnVacuum() --- .../features/inventory/ItemDisplayOverlayFeatures.kt | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'src/main/java') 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 29473a88a..aa3a81311 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/ItemDisplayOverlayFeatures.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/ItemDisplayOverlayFeatures.kt @@ -55,7 +55,8 @@ object ItemDisplayOverlayFeatures { private val gardenVacuumPatterm = "§7Vacuum Bag: §6(?\\d*) Pests?".toPattern() private val harvestPattern = "§7§7You may harvest §6(?.).*".toPattern() private val dungeonPotionPattern = "Dungeon (?.*) Potion".toPattern() - private val bingoGoalRankPattern = "(§.)*You were the (§.)*(?[\\w]+)(?(st|nd|rd|th)) (§.)*to".toPattern() + private val bingoGoalRankPattern = + "(§.)*You were the (§.)*(?[\\w]+)(?(st|nd|rd|th)) (§.)*to".toPattern() private val bottleOfJyrre = "NEW_BOTTLE_OF_JYRRE".asInternalName() @@ -202,13 +203,7 @@ object ItemDisplayOverlayFeatures { } } - if (VACUUM_GARDEN.isSelected() && item.getInternalNameOrNull() in PestAPI.vacuumVariants) { - for (line in lore) { - if (line.contains("Click to trade!") || line.contains("Starting bid:") || line.contains("Buy it now:")) { - return "" - } - } - + if (VACUUM_GARDEN.isSelected() && item.getInternalNameOrNull() in PestAPI.vacuumVariants && isOwnVacuum(lore)) { for (line in lore) { gardenVacuumPatterm.matchMatcher(line) { val pests = group("amount").formatNumber() @@ -251,6 +246,9 @@ object ItemDisplayOverlayFeatures { return "" } + private fun isOwnVacuum(lore: List) = + lore.none { it.contains("Click to trade!") || it.contains("Starting bid:") || it.contains("Buy it now:") } + var done = false private fun grabSackName(name: String): String { -- cgit