Search in sources :

Example 1 with IPathingBehavior

use of baritone.api.behavior.IPathingBehavior in project Spark-Client by Spark-Client-Development.

the class ETACommand method execute.

@Override
public void execute(String label, IArgConsumer args) throws CommandException {
    args.requireMax(0);
    IPathingControlManager pathingControlManager = baritone.getPathingControlManager();
    IBaritoneProcess process = pathingControlManager.mostRecentInControl().orElse(null);
    if (process == null) {
        throw new CommandInvalidStateException("No process in control");
    }
    IPathingBehavior pathingBehavior = baritone.getPathingBehavior();
    logDirect(String.format("Next segment: %.2f\n" + "Goal: %.2f", pathingBehavior.ticksRemainingInSegment().orElse(-1.0), pathingBehavior.estimatedTicksToGoal().orElse(-1.0)));
}
Also used : IPathingControlManager(baritone.api.pathing.calc.IPathingControlManager) IBaritoneProcess(baritone.api.process.IBaritoneProcess) CommandInvalidStateException(baritone.api.command.exception.CommandInvalidStateException) IPathingBehavior(baritone.api.behavior.IPathingBehavior)

Example 2 with IPathingBehavior

use of baritone.api.behavior.IPathingBehavior in project Spark-Client by Spark-Client-Development.

the class ForceCancelCommand method execute.

@Override
public void execute(String label, IArgConsumer args) throws CommandException {
    args.requireMax(0);
    IPathingBehavior pathingBehavior = baritone.getPathingBehavior();
    pathingBehavior.cancelEverything();
    pathingBehavior.forceCancel();
    logDirect("ok force canceled");
}
Also used : IPathingBehavior(baritone.api.behavior.IPathingBehavior)

Example 3 with IPathingBehavior

use of baritone.api.behavior.IPathingBehavior in project baritone by cabaletta.

the class ETACommand method execute.

@Override
public void execute(String label, IArgConsumer args) throws CommandException {
    args.requireMax(0);
    IPathingControlManager pathingControlManager = baritone.getPathingControlManager();
    IBaritoneProcess process = pathingControlManager.mostRecentInControl().orElse(null);
    if (process == null) {
        throw new CommandInvalidStateException("No process in control");
    }
    IPathingBehavior pathingBehavior = baritone.getPathingBehavior();
    logDirect(String.format("Next segment: %.2f\n" + "Goal: %.2f", pathingBehavior.ticksRemainingInSegment().orElse(-1.0), pathingBehavior.estimatedTicksToGoal().orElse(-1.0)));
}
Also used : IPathingControlManager(baritone.api.pathing.calc.IPathingControlManager) IBaritoneProcess(baritone.api.process.IBaritoneProcess) CommandInvalidStateException(baritone.api.command.exception.CommandInvalidStateException) IPathingBehavior(baritone.api.behavior.IPathingBehavior)

Example 4 with IPathingBehavior

use of baritone.api.behavior.IPathingBehavior in project baritone by cabaletta.

the class ForceCancelCommand method execute.

@Override
public void execute(String label, IArgConsumer args) throws CommandException {
    args.requireMax(0);
    IPathingBehavior pathingBehavior = baritone.getPathingBehavior();
    pathingBehavior.cancelEverything();
    pathingBehavior.forceCancel();
    logDirect("ok force canceled");
}
Also used : IPathingBehavior(baritone.api.behavior.IPathingBehavior)

Aggregations

IPathingBehavior (baritone.api.behavior.IPathingBehavior)4 CommandInvalidStateException (baritone.api.command.exception.CommandInvalidStateException)2 IPathingControlManager (baritone.api.pathing.calc.IPathingControlManager)2 IBaritoneProcess (baritone.api.process.IBaritoneProcess)2