diff --git a/index.js b/index.js index 20d5b78..e70d3ae 100644 --- a/index.js +++ b/index.js @@ -392,7 +392,6 @@ function inject (bot) { function stop () { stopPathing = false stateGoal = null - previousNode = null path = [] bot.emit('path_stop') fullStop() @@ -419,8 +418,6 @@ function inject (bot) { } }) - let previousNode = null - let lastOnGroundPos = null function monitorMovement () { @@ -603,7 +600,6 @@ function inject (bot) { stop() return } - previousNode = nextPoint path.shift() if (path.length === 0) { // done // If the block the bot is standing on is not a full block only checking for the floored position can fail as diff --git a/testing/index.js b/testing/index.js deleted file mode 100644 index 963f192..0000000 --- a/testing/index.js +++ /dev/null @@ -1,43 +0,0 @@ -const mineflayer = require('mineflayer') -const { pathfinder, Movements, goals } = require('../index') - -const bot = mineflayer.createBot({ - host: 'localhost', - port: 25565, - username: 'pathfind' -}) - -bot.loadPlugin(pathfinder) - -bot.once('inject_allowed', () => { - const movements = new Movements(bot) - - movements.climbables = new Set() - movements.maxDropDown = 30 - movements.canOpenDoors = false - movements.canDig = false - movements.scafoldingBlocks = [] - movements.placeCost = 999 - movements.allowParkour = false - movements.allowFreeMotion = true - movements.allowSprinting = true - movements.blocksToAvoid.add(22) - bot.pathfinder.setMovements(movements) - bot.pathfinder.thinkTimeout = 10000 - bot.pathfinder.tickTimeout = 40 -}) - -bot.on('kicked', console.log) - -// bot.on('spawn', () => { -// bot.chat('/tp -329 91 -56') -// bot.pathfinder.setGoal(new goals.GoalBlock(-362, 70, -60)) -// }) - -bot.on('physicsTick', () => { - const target = bot.players['Rnas'] - - if (!target) return - - bot.pathfinder.setGoal(new goals.GoalNear(target.entity.position.x, target.entity.position.y, target.entity.position.z, 3)) -})