diff options
author | Walker Selby <git@walkerselby.com> | 2023-09-29 11:30:27 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-29 20:30:27 +0200 |
commit | 343d5d9cea12beaf7a8dfabda2f61ad940be592a (patch) | |
tree | ceb0a82790eaa1a1babfe4a2e05220378037a748 /src/main/java/at/hannibal2/skyhanni/utils/ParkourHelper.kt | |
parent | b364b6da62668ea44dfc23180fe70c13ec707804 (diff) | |
download | skyhanni-343d5d9cea12beaf7a8dfabda2f61ad940be592a.tar.gz skyhanni-343d5d9cea12beaf7a8dfabda2f61ad940be592a.tar.bz2 skyhanni-343d5d9cea12beaf7a8dfabda2f61ad940be592a.zip |
Random Code Cleanup (#516)
Sonar Lint for the win #516
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/utils/ParkourHelper.kt')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/utils/ParkourHelper.kt | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/ParkourHelper.kt b/src/main/java/at/hannibal2/skyhanni/utils/ParkourHelper.kt index 3fe7f6973..7a780c3b5 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/ParkourHelper.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/ParkourHelper.kt @@ -53,10 +53,8 @@ class ParkourHelper( if (visible) { for ((index, location) in locations.withIndex()) { - if (location.offsetCenter().distanceToPlayer() < detectionRange) { - if (Minecraft.getMinecraft().thePlayer.onGround) { - current = index - } + if (location.offsetCenter().distanceToPlayer() < detectionRange && Minecraft.getMinecraft().thePlayer.onGround) { + current = index } } } @@ -64,10 +62,8 @@ class ParkourHelper( val distanceToPlayer = locations.first().offsetCenter().distanceToPlayer() if (distanceToPlayer < detectionRange) { visible = true - } else if (distanceToPlayer > 15) { - if (current < 1) { - visible = false - } + } else if (distanceToPlayer > 15 && current < 1) { + visible = false } if (!visible) return @@ -117,10 +113,8 @@ class ParkourHelper( event.drawFilledBoundingBox_nea(aabb, colorForIndex(index), 1f) if (outline) event.outlineTopFace(aabb, 2, Color.BLACK, true) } - if (SkyHanniMod.feature.dev.waypoint.showPlatformNumber) { - if (!isMovingPlatform) { - event.drawString(location.offsetCenter().add(0, 1, 0), "§a§l$index", seeThroughBlocks = true) - } + if (SkyHanniMod.feature.dev.waypoint.showPlatformNumber && !isMovingPlatform) { + event.drawString(location.offsetCenter().add(0, 1, 0), "§a§l$index", seeThroughBlocks = true) } } } catch (e: Throwable) { |