From f0058ad27543ad378c60c9469f578538f2aa627f Mon Sep 17 00:00:00 2001 From: aesthetic0001 <15858616+aesthetic0001@users.noreply.github.com> Date: Sat, 3 Feb 2024 20:14:26 -0500 Subject: [PATCH] test more pathfinding changes --- index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index a96cb84..750a131 100644 --- a/index.js +++ b/index.js @@ -583,6 +583,7 @@ function inject (bot) { let dx = nextPoint.x - p.x const dy = nextPoint.y - p.y let dz = nextPoint.z - p.z + const yChangeFromGround = lp ? p.y - lp.y : 0 /* eslint-disable multiline-ternary */ // const direction = previousNode ? { @@ -593,7 +594,7 @@ function inject (bot) { // console.log(direction) - if (Math.abs(dx) <= (!bot.entity.onGround ? 1.25 : 0.5) && Math.abs(dz) <= (!bot.entity.onGround ? 1.25 : 0.5) && Math.abs(dy) < 12) { + if (Math.abs(dx) <= (yChangeFromGround >= 1.5 ? Math.max(2, yChangeFromGround / 2) : 0.5) && Math.abs(dz) <= (yChangeFromGround > 1.5 ? Math.max(2, yChangeFromGround / 2) : 0.5) && Math.abs(dy) < 12) { // arrived at next point lastNodeTime = performance.now() if (stopPathing) {