aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/utils
diff options
context:
space:
mode:
authorJ10a1n15 <45315647+j10a1n15@users.noreply.github.com>2024-06-16 11:38:25 +0200
committerGitHub <noreply@github.com>2024-06-16 11:38:25 +0200
commit8a4bf42e75c5405a7cb096adf1135ce415fd0f5a (patch)
treeed07ee192f28ebd55e2cadf9909c6a52f379f88a /src/main/java/at/hannibal2/skyhanni/utils
parent6365ecd0e0708adaf3a8c74dbfaec413d34c173b (diff)
downloadskyhanni-8a4bf42e75c5405a7cb096adf1135ce415fd0f5a.tar.gz
skyhanni-8a4bf42e75c5405a7cb096adf1135ce415fd0f5a.tar.bz2
skyhanni-8a4bf42e75c5405a7cb096adf1135ce415fd0f5a.zip
Fix: Dynamic Text being hidden after 80 blocks (#2103)
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/utils')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/utils/RenderUtils.kt7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/RenderUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/RenderUtils.kt
index 7cb382d42..89489518c 100644
--- a/src/main/java/at/hannibal2/skyhanni/utils/RenderUtils.kt
+++ b/src/main/java/at/hannibal2/skyhanni/utils/RenderUtils.kt
@@ -209,7 +209,7 @@ object RenderUtils {
z: Double,
rgb: Int,
alphaMultiplier: Float,
- partialTicks: Float
+ partialTicks: Float,
) {
val height = 300
val bottomOffset = 0
@@ -1009,6 +1009,7 @@ object RenderUtils {
smallestDistanceVew: Double = 5.0,
ignoreBlocks: Boolean = true,
ignoreY: Boolean = false,
+ maxDistance: Int? = null,
) {
val thePlayer = Minecraft.getMinecraft().thePlayer
val x = location.x
@@ -1030,7 +1031,9 @@ object RenderUtils {
distToPlayer = distToPlayer.coerceAtLeast(smallestDistanceVew)
if (distToPlayer < hideTooCloseAt) return
- if (ignoreBlocks && distToPlayer > 80) return
+ maxDistance?.let {
+ if (ignoreBlocks && distToPlayer > it) return
+ }
val distRender = distToPlayer.coerceAtMost(50.0)