Skip to content

Commit

Permalink
Fix: Fished Item name display (hannibal002#2371)
Browse files Browse the repository at this point in the history
Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com>
  • Loading branch information
2 people authored and MTOnline69 committed Sep 10, 2024
1 parent 635a027 commit 3b3b9a3
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/main/java/at/hannibal2/skyhanni/data/HypixelData.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand All @@ -27,7 +29,7 @@ object ShowFishingItemName {
// Taken from Skytils
private val cheapCoins = setOf(
"eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNTM4MDcxNzIxY2M1YjRjZDQwNmNlNDMxYTEzZjg2MDgzYTg5NzNlMTA2NGQyZjg4OTc4Njk5MzBlZTZlNTIzNyJ9fX0=",
"eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZGZhMDg3ZWI3NmU3Njg3YTgxZTRlZjgxYTdlNjc3MjY0OTk5MGY2MTY3Y2ViMGY3NTBhNGM1ZGViNmM0ZmJhZCJ9fX0="
"eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZGZhMDg3ZWI3NmU3Njg3YTgxZTRlZjgxYTdlNjc3MjY0OTk5MGY2MTY3Y2ViMGY3NTBhNGM1ZGViNmM0ZmJhZCJ9fX0=",
)

@SubscribeEvent
Expand Down Expand Up @@ -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()
}
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 3b3b9a3

Please sign in to comment.