From a9b1d13f7f03de23c58b3c8a621c0827e7c52612 Mon Sep 17 00:00:00 2001 From: MaxRobinsonTheGreat Date: Sat, 26 Oct 2024 17:13:08 -0500 Subject: [PATCH] mostly fixed infinite jump bug --- patches/mineflayer-pathfinder+2.4.5.patch | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/patches/mineflayer-pathfinder+2.4.5.patch b/patches/mineflayer-pathfinder+2.4.5.patch index 4c8dc93..6906371 100644 --- a/patches/mineflayer-pathfinder+2.4.5.patch +++ b/patches/mineflayer-pathfinder+2.4.5.patch @@ -1,17 +1,16 @@ diff --git a/node_modules/mineflayer-pathfinder/index.js b/node_modules/mineflayer-pathfinder/index.js -index b38bd30..cfaa677 100644 +index b38bd30..bf16a63 100644 --- a/node_modules/mineflayer-pathfinder/index.js +++ b/node_modules/mineflayer-pathfinder/index.js -@@ -541,7 +541,7 @@ function inject (bot) { - let canPlace = true - if (placingBlock.jump) { - bot.setControlState('jump', true) -- canPlace = placingBlock.y + 1 < bot.entity.position.y -+ canPlace = placingBlock.y + 1.8 < bot.entity.position.y - } - if (canPlace) { - if (!lockEquipItem.tryAcquire()) return -@@ -557,6 +557,7 @@ function inject (bot) { +@@ -550,6 +550,7 @@ function inject (bot) { + lockEquipItem.release() + const refBlock = bot.blockAt(new Vec3(placingBlock.x, placingBlock.y, placingBlock.z), false) + if (!lockPlaceBlock.tryAcquire()) return ++ bot.world.setBlockStateId(refBlock.position.offset(placingBlock.dx, placingBlock.dy, placingBlock.dz), 1) + if (interactableBlocks.includes(refBlock.name)) { + bot.setControlState('sneak', true) + } +@@ -557,6 +558,7 @@ function inject (bot) { .then(function () { // Dont release Sneak if the block placement was not successful bot.setControlState('sneak', false)