From da576298b3d91066f9ad60319bc7a42c0578750d Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal002@users.noreply.github.com> Date: Sun, 18 Aug 2024 09:25:20 +0200 Subject: Fix: Fished Item name display (#2371) Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com> --- .../java/at/hannibal2/skyhanni/data/HypixelData.kt | 2 +- .../skyhanni/features/fishing/ShowFishingItemName.kt | 19 +++++++++++++++++-- .../features/misc/discordrpc/DiscordStatus.kt | 2 +- 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/src/main/java/at/hannibal2/skyhanni/data/HypixelData.kt b/src/main/java/at/hannibal2/skyhanni/data/HypixelData.kt index 14aa579ca..0cd806f57 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/HypixelData.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/HypixelData.kt @@ -318,7 +318,7 @@ object HypixelData { if (LorenzUtils.onHypixel && LorenzUtils.inSkyBlock) { loop@ for (line in ScoreboardData.sidebarLinesFormatted) { skyblockAreaPattern.matchMatcher(line) { - val originalLocation = group("area") + val originalLocation = group("area").removeColor() skyBlockArea = LocationFixData.fixLocation(skyBlockIsland) ?: originalLocation skyBlockAreaWithSymbol = line.trim() break@loop diff --git a/src/main/java/at/hannibal2/skyhanni/features/fishing/ShowFishingItemName.kt b/src/main/java/at/hannibal2/skyhanni/features/fishing/ShowFishingItemName.kt index f50cd9a6b..04b4fc748 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/fishing/ShowFishingItemName.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/fishing/ShowFishingItemName.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.features.fishing import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.data.IslandType import at.hannibal2.skyhanni.events.LorenzRenderWorldEvent import at.hannibal2.skyhanni.events.LorenzTickEvent import at.hannibal2.skyhanni.features.fishing.FishingAPI.isBait @@ -10,6 +11,7 @@ import at.hannibal2.skyhanni.utils.EntityUtils import at.hannibal2.skyhanni.utils.ItemUtils.getSkullTexture import at.hannibal2.skyhanni.utils.ItemUtils.name import at.hannibal2.skyhanni.utils.LorenzUtils +import at.hannibal2.skyhanni.utils.LorenzUtils.isInIsland import at.hannibal2.skyhanni.utils.RenderUtils.drawString import at.hannibal2.skyhanni.utils.RenderUtils.exactLocation import at.hannibal2.skyhanni.utils.StringUtils.removeColor @@ -27,7 +29,7 @@ object ShowFishingItemName { // Taken from Skytils private val cheapCoins = setOf( "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNTM4MDcxNzIxY2M1YjRjZDQwNmNlNDMxYTEzZjg2MDgzYTg5NzNlMTA2NGQyZjg4OTc4Njk5MzBlZTZlNTIzNyJ9fX0=", - "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZGZhMDg3ZWI3NmU3Njg3YTgxZTRlZjgxYTdlNjc3MjY0OTk5MGY2MTY3Y2ViMGY3NTBhNGM1ZGViNmM0ZmJhZCJ9fX0=" + "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZGZhMDg3ZWI3NmU3Njg3YTgxZTRlZjgxYTdlNjc3MjY0OTk5MGY2MTY3Y2ViMGY3NTBhNGM1ZGViNmM0ZmJhZCJ9fX0=", ) @SubscribeEvent @@ -67,5 +69,18 @@ object ShowFishingItemName { } } - fun isEnabled() = LorenzUtils.inSkyBlock && config.enabled && FishingAPI.holdingRod + fun inCorrectArea(): Boolean { + if (IslandType.HUB.isInIsland()) { + LorenzUtils.skyBlockArea?.let { + if (it.endsWith(" Atrium")) return false + if (it.endsWith(" Museum")) return false + if (it == "Fashion Shop") return false + if (it == "Shen's Auction") return false + } + } + if (IslandType.THE_END.isInIsland()) return false + return true + } + + fun isEnabled() = LorenzUtils.inSkyBlock && config.enabled && FishingAPI.holdingRod && inCorrectArea() } diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/discordrpc/DiscordStatus.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/discordrpc/DiscordStatus.kt index 53121e39a..47472d2fe 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/discordrpc/DiscordStatus.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/discordrpc/DiscordStatus.kt @@ -86,7 +86,7 @@ enum class DiscordStatus(private val displayMessageSupplier: (() -> String?)) { NONE({ null }), LOCATION({ - var location = LorenzUtils.skyBlockArea?.removeColor() ?: "invalid" + var location = LorenzUtils.skyBlockArea ?: "invalid" val island = LorenzUtils.skyBlockIsland if (location == "Your Island") location = "Private Island" -- cgit