mirror of
https://github.com/cabaletta/baritone
synced 2025-05-01 07:39:42 +00:00
better behavior on arrival and failure
This commit is contained in:
parent
42513e4b56
commit
9a29f9ce57
@ -82,12 +82,13 @@ public class GetToBlockProcess extends BaritoneProcessHelper implements IGetToBl
|
|||||||
}
|
}
|
||||||
return new PathingCommand(null, PathingCommandType.CANCEL_AND_SET_GOAL);
|
return new PathingCommand(null, PathingCommandType.CANCEL_AND_SET_GOAL);
|
||||||
}
|
}
|
||||||
|
Goal goal = new GoalComposite(knownLocations.stream().map(this::createGoal).toArray(Goal[]::new));
|
||||||
if (calcFailed) {
|
if (calcFailed) {
|
||||||
logDirect("Unable to find any path to " + gettingTo + ", canceling GetToBlock");
|
logDirect("Unable to find any path to " + gettingTo + ", canceling GetToBlock");
|
||||||
if (isSafeToCancel) {
|
if (isSafeToCancel) {
|
||||||
onLostControl();
|
onLostControl();
|
||||||
}
|
}
|
||||||
return new PathingCommand(null, PathingCommandType.CANCEL_AND_SET_GOAL);
|
return new PathingCommand(goal, PathingCommandType.CANCEL_AND_SET_GOAL);
|
||||||
}
|
}
|
||||||
int mineGoalUpdateInterval = Baritone.settings().mineGoalUpdateInterval.get();
|
int mineGoalUpdateInterval = Baritone.settings().mineGoalUpdateInterval.get();
|
||||||
if (mineGoalUpdateInterval != 0 && tickCount++ % mineGoalUpdateInterval == 0) { // big brain
|
if (mineGoalUpdateInterval != 0 && tickCount++ % mineGoalUpdateInterval == 0) { // big brain
|
||||||
@ -95,15 +96,16 @@ public class GetToBlockProcess extends BaritoneProcessHelper implements IGetToBl
|
|||||||
CalculationContext context = new CalculationContext(baritone, true);
|
CalculationContext context = new CalculationContext(baritone, true);
|
||||||
Baritone.getExecutor().execute(() -> rescan(current, context));
|
Baritone.getExecutor().execute(() -> rescan(current, context));
|
||||||
}
|
}
|
||||||
Goal goal = new GoalComposite(knownLocations.stream().map(this::createGoal).toArray(Goal[]::new));
|
|
||||||
if (goal.isInGoal(ctx.playerFeet()) && isSafeToCancel) {
|
if (goal.isInGoal(ctx.playerFeet()) && isSafeToCancel) {
|
||||||
// we're there
|
// we're there
|
||||||
if (rightClickOnArrival(gettingTo)) {
|
if (rightClickOnArrival(gettingTo)) {
|
||||||
if (rightClick()) {
|
if (rightClick()) {
|
||||||
onLostControl();
|
onLostControl();
|
||||||
|
return new PathingCommand(null, PathingCommandType.CANCEL_AND_SET_GOAL);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
onLostControl();
|
onLostControl();
|
||||||
|
return new PathingCommand(null, PathingCommandType.CANCEL_AND_SET_GOAL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return new PathingCommand(goal, PathingCommandType.REVALIDATE_GOAL_AND_PATH);
|
return new PathingCommand(goal, PathingCommandType.REVALIDATE_GOAL_AND_PATH);
|
||||||
|
Loading…
Reference in New Issue
Block a user