diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-08-07 14:00:29 +0200 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-08-07 14:00:29 +0200 |
commit | f221b83d186f50f49ed079764b4f9d871aef2bd2 (patch) | |
tree | 7e766490362335c909f73af219bd8131895d06ea | |
parent | e8b66407e990e07030b2ec6c67863c72ba80a3d4 (diff) | |
download | skyhanni-f221b83d186f50f49ed079764b4f9d871aef2bd2.tar.gz skyhanni-f221b83d186f50f49ed079764b4f9d871aef2bd2.tar.bz2 skyhanni-f221b83d186f50f49ed079764b4f9d871aef2bd2.zip |
Hide crystal hollows area names below the nucleus
3 files changed, 6 insertions, 5 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/mining/crystalhollows/CrystalHollowsNamesInCore.kt b/src/main/java/at/hannibal2/skyhanni/features/mining/crystalhollows/CrystalHollowsNamesInCore.kt index b8367b3d0..e127f80ed 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/mining/crystalhollows/CrystalHollowsNamesInCore.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/mining/crystalhollows/CrystalHollowsNamesInCore.kt @@ -3,7 +3,8 @@ package at.hannibal2.skyhanni.features.mining.crystalhollows import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.data.IslandType import at.hannibal2.skyhanni.events.LorenzTickEvent -import at.hannibal2.skyhanni.utils.LocationUtils.distanceToPlayerIgnoreYSq +import at.hannibal2.skyhanni.utils.LocationUtils +import at.hannibal2.skyhanni.utils.LocationUtils.distanceToPlayerSqIgnoreY import at.hannibal2.skyhanni.utils.LorenzUtils.isInIsland import at.hannibal2.skyhanni.utils.LorenzVec import at.hannibal2.skyhanni.utils.RenderUtils.drawDynamicText @@ -27,7 +28,7 @@ class CrystalHollowsNamesInCore { if (event.isMod(10)) { val center = LorenzVec(514.3, 106.0, 514.3) - showWaypoints = center.distanceToPlayerIgnoreYSq() < 1100 + showWaypoints = center.distanceToPlayerSqIgnoreY() < 1100 && LocationUtils.playerLocation().y > 65 } } diff --git a/src/main/java/at/hannibal2/skyhanni/utils/LocationUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/LocationUtils.kt index 9fcba58f5..70ac2a3e9 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/LocationUtils.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/LocationUtils.kt @@ -14,7 +14,7 @@ object LocationUtils { fun LorenzVec.distanceToPlayer() = distance(playerLocation()) - fun LorenzVec.distanceToPlayerIgnoreYSq() = distanceIgnoreYSq(playerLocation()) + fun LorenzVec.distanceToPlayerSqIgnoreY() = distanceSqIgnoreY(playerLocation()) fun Entity.distanceToPlayer() = getLorenzVec().distance(playerLocation()) diff --git a/src/main/java/at/hannibal2/skyhanni/utils/LorenzVec.kt b/src/main/java/at/hannibal2/skyhanni/utils/LorenzVec.kt index 5f719da63..06d1f8c4a 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/LorenzVec.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/LorenzVec.kt @@ -23,7 +23,7 @@ data class LorenzVec( fun toVec3(): Vec3 = Vec3(x, y, z) - fun distanceIgnoreY(other: LorenzVec): Double = distanceIgnoreYSq(other).pow(0.5) + fun distanceIgnoreY(other: LorenzVec): Double = distanceSqIgnoreY(other).pow(0.5) fun distance(other: LorenzVec): Double = distanceSq(other).pow(0.5) @@ -38,7 +38,7 @@ data class LorenzVec( return (dx * dx + dy * dy + dz * dz) } - fun distanceIgnoreYSq(other: LorenzVec): Double { + fun distanceSqIgnoreY(other: LorenzVec): Double { val dx = (other.x - x) val dz = (other.z - z) return (dx * dx + dz * dz) |