From 343d5d9cea12beaf7a8dfabda2f61ad940be592a Mon Sep 17 00:00:00 2001 From: Walker Selby Date: Fri, 29 Sep 2023 11:30:27 -0700 Subject: Random Code Cleanup (#516) Sonar Lint for the win #516 --- .../java/at/hannibal2/skyhanni/utils/ParkourHelper.kt | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) (limited to 'src/main/java/at/hannibal2/skyhanni/utils/ParkourHelper.kt') 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) { -- cgit