From 6f020d1cb58ed282c597ee2691b3c816b2f7b375 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Sun, 22 Oct 2023 20:46:51 +0200 Subject: fixed fishing hook display triggering on wrong texts. --- .../at/hannibal2/skyhanni/features/fishing/FishingHookDisplay.kt | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'src/main/java/at/hannibal2') diff --git a/src/main/java/at/hannibal2/skyhanni/features/fishing/FishingHookDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/fishing/FishingHookDisplay.kt index 4275bbbfc..c05ffcc80 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/fishing/FishingHookDisplay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/fishing/FishingHookDisplay.kt @@ -19,6 +19,7 @@ class FishingHookDisplay { private var bobber: EntityFishHook? = null private var armorStand: EntityArmorStand? = null private val potentionArmorStands = mutableListOf() + private val pattern = "§e§l(\\d+(\\.\\d+)?)".toPattern() @SubscribeEvent fun onWorldChange(event: LorenzWorldChangeEvent) { @@ -91,11 +92,7 @@ class FishingHookDisplay { if (name == "§c§l!!!") { return true } - if (name.startsWith("§e§l") && !name.contains("CLICK")) { - return true - } - - return false + return pattern.matcher(name).matches() } fun isEnabled() = LorenzUtils.inSkyBlock && config.enabled && FishingAPI.hasFishingRodInHand() -- cgit