From ef61176292763768d1f7e12e5113d7a2f76d0c9c Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Wed, 15 Nov 2023 10:23:05 +0100 Subject: more exact checks for fandom wiki click check: fixed blocking clicks on bazaar with player name "wiki" --- .../java/at/hannibal2/skyhanni/features/misc/FandomWikiFromMenus.kt | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/main/java/at/hannibal2/skyhanni') diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/FandomWikiFromMenus.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/FandomWikiFromMenus.kt index 44d4b94ed..eb658b865 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/FandomWikiFromMenus.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/FandomWikiFromMenus.kt @@ -8,7 +8,6 @@ import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName import at.hannibal2.skyhanni.utils.ItemUtils.getLore import at.hannibal2.skyhanni.utils.ItemUtils.nameWithEnchantment import at.hannibal2.skyhanni.utils.LorenzUtils -import at.hannibal2.skyhanni.utils.LorenzUtils.anyContains import at.hannibal2.skyhanni.utils.OSUtils import at.hannibal2.skyhanni.utils.StringUtils.removeColor import io.github.moulberry.notenoughupdates.events.SlotClickEvent @@ -56,8 +55,8 @@ class FandomWikiFromMenus { } else { //.lowercase() to match "Wiki!" and ".*wiki.*" lore lines in one fell swoop val inThirdWikiInventory = // TODO better name for this inventory - (itemClickedStack.getLore().anyContains("Wiki") || itemClickedStack.getLore().anyContains("wiki")) - && !itemClickedStack.getLore().anyContains("wikipedia") + (itemClickedStack.getLore() + .let { it.any { line -> line == "§7§eClick to view on the SkyBlock" } && it.last() == "§eWiki!" }) if (inThirdWikiInventory) { wikiDisplayName = itemClickedName.removeColor().replace("✔ ", "").replace("✖ ", "") wikiInternalName = wikiDisplayName -- cgit