diff options
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/utils')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/utils/ParkourHelper.kt | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/ParkourHelper.kt b/src/main/java/at/hannibal2/skyhanni/utils/ParkourHelper.kt index cf01b2bf9..4fccbed68 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/ParkourHelper.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/ParkourHelper.kt @@ -23,6 +23,7 @@ class ParkourHelper( val detectionRange: Double = 1.0, val depth: Boolean = true, val onEndReach: () -> Unit = {}, + val goInOrder: Boolean = false, ) { private var current = -1 @@ -58,9 +59,9 @@ class ParkourHelper( for ((index, location) in locations.withIndex()) { val onGround = Minecraft.getMinecraft().thePlayer.onGround val closeEnough = location.offsetCenter().distanceToPlayer() < detectionRange - if (closeEnough && onGround) { - current = index - } + if (!(closeEnough && onGround)) continue + if (goInOrder && (index < current - 1 || index > current + 1)) continue + current = index } } |