aboutsummaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/damageindicator/DamageIndicatorManager.kt6
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/miniboss/DailyMiniBossHelper.kt5
2 files changed, 11 insertions, 0 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/damageindicator/DamageIndicatorManager.kt b/src/main/java/at/hannibal2/skyhanni/features/damageindicator/DamageIndicatorManager.kt
index f98e5da94..40d96104e 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/damageindicator/DamageIndicatorManager.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/damageindicator/DamageIndicatorManager.kt
@@ -78,6 +78,12 @@ class DamageIndicatorManager {
list.minOf { it }
}
}
+
+ fun getNearestDistanceTo(location: LorenzVec): Double {
+ return data.values
+ .map { it.entity.getLorenzVec() }
+ .minOfOrNull { it.distance(location) } ?: Double.MAX_VALUE
+ }
}
@SubscribeEvent
diff --git a/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/miniboss/DailyMiniBossHelper.kt b/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/miniboss/DailyMiniBossHelper.kt
index 3b3bdef44..a43c10758 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/miniboss/DailyMiniBossHelper.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/miniboss/DailyMiniBossHelper.kt
@@ -4,8 +4,10 @@ import at.hannibal2.skyhanni.SkyHanniMod
import at.hannibal2.skyhanni.data.HyPixelData
import at.hannibal2.skyhanni.data.IslandType
import at.hannibal2.skyhanni.events.LorenzChatEvent
+import at.hannibal2.skyhanni.features.damageindicator.DamageIndicatorManager
import at.hannibal2.skyhanni.features.nether.reputationhelper.CrimsonIsleReputationHelper
import at.hannibal2.skyhanni.test.GriffinUtils.drawWaypointFilled
+import at.hannibal2.skyhanni.utils.LocationUtils
import at.hannibal2.skyhanni.utils.LorenzColor
import at.hannibal2.skyhanni.utils.LorenzUtils
import at.hannibal2.skyhanni.utils.NEUItems
@@ -40,9 +42,12 @@ class DailyMiniBossHelper(private val reputationHelper: CrimsonIsleReputationHel
if (!SkyHanniMod.feature.misc.crimsonIsleReputationHelper) return
if (!SkyHanniMod.feature.misc.crimsonIsleReputationLocation) return
+ val playerLocation = LocationUtils.playerLocation()
for (miniBoss in miniBosses) {
if (!miniBoss.doneToday) {
val location = miniBoss.location ?: continue
+ if (DamageIndicatorManager.getNearestDistanceTo(location) < 40 && playerLocation.distance(location) < 40) continue
+
event.drawWaypointFilled(location, LorenzColor.WHITE.toColor())
event.drawDynamicText(location, miniBoss.displayName, 1.5)
}