From 7a6f576cbea6e37aeda014df40cfce69a0109a6c Mon Sep 17 00:00:00 2001 From: CalMWolfs <94038482+CalMWolfs@users.noreply.github.com> Date: Thu, 4 Apr 2024 05:12:18 +1100 Subject: Fix: Don't check for thunder sparks when not needed (#1345) --- .../hannibal2/skyhanni/features/fishing/ThunderSparksHighlight.kt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/main/java/at/hannibal2/skyhanni') diff --git a/src/main/java/at/hannibal2/skyhanni/features/fishing/ThunderSparksHighlight.kt b/src/main/java/at/hannibal2/skyhanni/features/fishing/ThunderSparksHighlight.kt index e49e8e3f8..a9fd806ac 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/fishing/ThunderSparksHighlight.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/fishing/ThunderSparksHighlight.kt @@ -2,6 +2,7 @@ package at.hannibal2.skyhanni.features.fishing import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator +import at.hannibal2.skyhanni.data.IslandType import at.hannibal2.skyhanni.events.LorenzRenderWorldEvent import at.hannibal2.skyhanni.events.LorenzTickEvent import at.hannibal2.skyhanni.events.LorenzWorldChangeEvent @@ -12,6 +13,7 @@ import at.hannibal2.skyhanni.utils.EntityUtils.hasSkullTexture import at.hannibal2.skyhanni.utils.LocationUtils import at.hannibal2.skyhanni.utils.LocationUtils.distanceToPlayer 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.SpecialColour import at.hannibal2.skyhanni.utils.getLorenzVec @@ -31,7 +33,6 @@ class ThunderSparksHighlight { fun onTick(event: LorenzTickEvent) { if (!isEnabled()) return - EntityUtils.getEntities().filter { it !in sparks && it.hasSkullTexture(texture) }.forEach { sparks.add(it) } @@ -65,9 +66,8 @@ class ThunderSparksHighlight { sparks.clear() } - private fun isEnabled(): Boolean { - return LorenzUtils.inSkyBlock && config.highlight - } + private fun isEnabled() = + (IslandType.CRIMSON_ISLE.isInIsland() || LorenzUtils.isStrandedProfile) && config.highlight @SubscribeEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { -- cgit