Skip to content

Commit

Permalink
Fix TreeBot breaking leaves while jumping
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander01998 committed Oct 31, 2023
1 parent 032111b commit bfe9c51
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 1 deletion.
6 changes: 6 additions & 0 deletions src/main/java/net/wurstclient/ai/FlyPathProcessor.java
Original file line number Diff line number Diff line change
Expand Up @@ -151,4 +151,10 @@ else if(posVec.y < nextBox.minY)
}
}
}

@Override
public boolean canBreakBlocks()
{
return true;
}
}
2 changes: 2 additions & 0 deletions src/main/java/net/wurstclient/ai/PathProcessor.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ public PathProcessor(ArrayList<PathPos> path)

public abstract void process();

public abstract boolean canBreakBlocks();

public final int getIndex()
{
return index;
Expand Down
6 changes: 6 additions & 0 deletions src/main/java/net/wurstclient/ai/WalkPathProcessor.java
Original file line number Diff line number Diff line change
Expand Up @@ -138,4 +138,10 @@ public void process()
MC.options.forwardKey.setPressed(true);
}
}

@Override
public boolean canBreakBlocks()
{
return MC.player.isOnGround();
}
}
2 changes: 1 addition & 1 deletion src/main/java/net/wurstclient/hacks/TreeBotHack.java
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ public void goToGoal()
return;
}

if(breakBlocks(getLeavesOnPath()))
if(processor.canBreakBlocks() && breakBlocks(getLeavesOnPath()))
return;

processor.process();
Expand Down

0 comments on commit bfe9c51

Please sign in to comment.