Skip to content

Commit

Permalink
Bug fix
Browse files Browse the repository at this point in the history
Auto Pest Exchange:
- Fixed the macro getting stuck by baritone
  • Loading branch information
onixiya1337 committed Mar 21, 2024
1 parent ecf32fd commit 135922b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ baseGroup=com.jelly.farmhelperv2
mcVersion=1.8.9
modid=farmhelperv2
modName=FarmHelper
version=2.5.4
version=2.5.5-pre1
shouldRelease=true
Original file line number Diff line number Diff line change
Expand Up @@ -342,9 +342,9 @@ public void onTickExecution(TickEvent.ClientTickEvent event) {
FlyPathFinderExecutor.getInstance().findPath(new Vec3(deskPos()).addVector(0.5, 0.5, 0.5), false, true);
break;
}
phillip = getPhillip();
if (BaritoneHandler.isPathing())
if (BaritoneHandler.isWalkingToGoalBlock())
break;
phillip = getPhillip();
if (FlyPathFinderExecutor.getInstance().isRunning()) {
if (phillip == null) {
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public class BaritoneHandler {
public static boolean pathing = false;

public static boolean isWalkingToGoalBlock() {
return pathing && BaritoneEventListener.pathEvent != PathEvent.CANCELED && BaritoneEventListener.pathEvent != PathEvent.AT_GOAL;
return isWalkingToGoalBlock(0.75);
}

public static boolean isWalkingToGoalBlock(double nearGoalDistance) {
Expand All @@ -35,9 +35,9 @@ public static boolean isWalkingToGoalBlock(double nearGoalDistance) {
} else {
distance = goal.isInGoal(mc.thePlayer.getPosition()) ? 0 : goal.heuristic();
}
System.out.println("Pathing result: " + BaritoneEventListener.pathEvent);
System.out.println("Distance: " + distance);
System.out.println("Goal: " + goal);
// System.out.println("Pathing result: " + BaritoneEventListener.pathEvent);
// System.out.println("Distance: " + distance);
// System.out.println("Goal: " + goal);
if (distance <= nearGoalDistance || BaritoneEventListener.pathEvent == PathEvent.AT_GOAL) {
BaritoneAPI.getProvider().getPrimaryBaritone().getPathingBehavior().cancelEverything();
pathing = false;
Expand Down

0 comments on commit 135922b

Please sign in to comment.