Skip to content

Commit c65dfb5

Browse files
committed
Less frequent pathing updates
1 parent 7ccb5d4 commit c65dfb5

File tree

1 file changed

+4
-2
lines changed
  • common/src/main/kotlin/com/lambda/module/modules/movement

1 file changed

+4
-2
lines changed

common/src/main/kotlin/com/lambda/module/modules/movement/Pathfinder.kt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ import com.lambda.util.player.MovementUtils.mergeFrom
5252
import com.lambda.util.world.FastVector
5353
import com.lambda.util.world.WorldUtils.hasSupport
5454
import com.lambda.util.world.WorldUtils.isPathClear
55+
import com.lambda.util.world.dist
5556
import com.lambda.util.world.fastVectorOf
5657
import com.lambda.util.world.toBlockPos
5758
import com.lambda.util.world.toFastVec
@@ -117,8 +118,9 @@ object Pathfinder : Module(
117118

118119
listen<TickEvent.Pre> {
119120
val playerPos = player.blockPos
120-
if (player.isOnGround && hasSupport(playerPos)) {
121-
currentStart = playerPos.toFastVec()
121+
val currentPos = playerPos.toFastVec()
122+
if (player.isOnGround && hasSupport(playerPos) && currentPos dist currentStart > pathing.tolerance) {
123+
currentStart = currentPos
122124
needsUpdate = true
123125
}
124126
if (pathing.moveAlongPath) updateTargetNode()

0 commit comments

Comments
 (0)