Skip to content

Commit

Permalink
recovery
Browse files Browse the repository at this point in the history
  • Loading branch information
GenerelSchwerz committed Feb 23, 2024
1 parent 3603674 commit 5195c0e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
1 change: 0 additions & 1 deletion examples/example.js
Original file line number Diff line number Diff line change
Expand Up @@ -566,4 +566,3 @@ function rayTraceEntitySight(options) {

bot.on("kicked", console.log);

bot.pathfinder.currentAStar?.mostRecentNode
5 changes: 2 additions & 3 deletions src/mineflayer-specific/algs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ export interface PathProducer {
export class AStar extends AAStarBackOff<Move> {
visitedChunks: Set<string>

mostRecentNode: PathNode = this.bestNode // also known as start


constructor (
start: Move,
movements: MovementProvider<Move>,
Expand All @@ -39,8 +40,6 @@ export class AStar extends AAStarBackOff<Move> {
// Checking with if statement is slow.
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
this.visitedChunks.add(`${node.data!.x >> 4},${node.data!.z >> 4}`)

this.mostRecentNode = node
}

public override compute (): Path {
Expand Down

0 comments on commit 5195c0e

Please sign in to comment.