Search in sources :

Example 1 with ICustomGoalProcess

use of baritone.api.process.ICustomGoalProcess in project baritone by cabaletta.

the class GoalCommand method execute.

@Override
public void execute(String label, IArgConsumer args) throws CommandException {
    ICustomGoalProcess goalProcess = baritone.getCustomGoalProcess();
    if (args.hasAny() && Arrays.asList("reset", "clear", "none").contains(args.peekString())) {
        args.requireMax(1);
        if (goalProcess.getGoal() != null) {
            goalProcess.setGoal(null);
            logDirect("Cleared goal");
        } else {
            logDirect("There was no goal to clear");
        }
    } else {
        args.requireMax(3);
        BetterBlockPos origin = baritone.getPlayerContext().playerFeet();
        Goal goal = args.getDatatypePost(RelativeGoal.INSTANCE, origin);
        goalProcess.setGoal(goal);
        logDirect(String.format("Goal: %s", goal.toString()));
    }
}
Also used : RelativeGoal(baritone.api.command.datatypes.RelativeGoal) Goal(baritone.api.pathing.goals.Goal) ICustomGoalProcess(baritone.api.process.ICustomGoalProcess) BetterBlockPos(baritone.api.utils.BetterBlockPos)

Example 2 with ICustomGoalProcess

use of baritone.api.process.ICustomGoalProcess in project baritone by cabaletta.

the class PathCommand method execute.

@Override
public void execute(String label, IArgConsumer args) throws CommandException {
    ICustomGoalProcess customGoalProcess = baritone.getCustomGoalProcess();
    args.requireMax(0);
    WorldScanner.INSTANCE.repack(ctx);
    customGoalProcess.path();
    logDirect("Now pathing");
}
Also used : ICustomGoalProcess(baritone.api.process.ICustomGoalProcess)

Example 3 with ICustomGoalProcess

use of baritone.api.process.ICustomGoalProcess in project Spark-Client by Spark-Client-Development.

the class InvertCommand method execute.

@Override
public void execute(String label, IArgConsumer args) throws CommandException {
    args.requireMax(0);
    ICustomGoalProcess customGoalProcess = baritone.getCustomGoalProcess();
    Goal goal;
    if ((goal = customGoalProcess.getGoal()) == null) {
        throw new CommandInvalidStateException("No goal");
    }
    if (goal instanceof GoalInverted) {
        goal = ((GoalInverted) goal).origin;
    } else {
        goal = new GoalInverted(goal);
    }
    customGoalProcess.setGoalAndPath(goal);
    logDirect(String.format("Goal: %s", goal.toString()));
}
Also used : Goal(baritone.api.pathing.goals.Goal) ICustomGoalProcess(baritone.api.process.ICustomGoalProcess) CommandInvalidStateException(baritone.api.command.exception.CommandInvalidStateException) GoalInverted(baritone.api.pathing.goals.GoalInverted)

Example 4 with ICustomGoalProcess

use of baritone.api.process.ICustomGoalProcess in project Spark-Client by Spark-Client-Development.

the class PathCommand method execute.

@Override
public void execute(String label, IArgConsumer args) throws CommandException {
    ICustomGoalProcess customGoalProcess = baritone.getCustomGoalProcess();
    args.requireMax(0);
    WorldScanner.INSTANCE.repack(ctx);
    customGoalProcess.path();
    logDirect("Now pathing");
}
Also used : ICustomGoalProcess(baritone.api.process.ICustomGoalProcess)

Example 5 with ICustomGoalProcess

use of baritone.api.process.ICustomGoalProcess in project Spark-Client by Spark-Client-Development.

the class GoalCommand method execute.

@Override
public void execute(String label, IArgConsumer args) throws CommandException {
    ICustomGoalProcess goalProcess = baritone.getCustomGoalProcess();
    if (args.hasAny() && Arrays.asList("reset", "clear", "none").contains(args.peekString())) {
        args.requireMax(1);
        if (goalProcess.getGoal() != null) {
            goalProcess.setGoal(null);
            logDirect("Cleared goal");
        } else {
            logDirect("There was no goal to clear");
        }
    } else {
        args.requireMax(3);
        BetterBlockPos origin = baritone.getPlayerContext().playerFeet();
        Goal goal = args.getDatatypePost(RelativeGoal.INSTANCE, origin);
        goalProcess.setGoal(goal);
        logDirect(String.format("Goal: %s", goal.toString()));
    }
}
Also used : RelativeGoal(baritone.api.command.datatypes.RelativeGoal) Goal(baritone.api.pathing.goals.Goal) ICustomGoalProcess(baritone.api.process.ICustomGoalProcess) BetterBlockPos(baritone.api.utils.BetterBlockPos)

Aggregations

ICustomGoalProcess (baritone.api.process.ICustomGoalProcess)6 Goal (baritone.api.pathing.goals.Goal)4 RelativeGoal (baritone.api.command.datatypes.RelativeGoal)2 CommandInvalidStateException (baritone.api.command.exception.CommandInvalidStateException)2 GoalInverted (baritone.api.pathing.goals.GoalInverted)2 BetterBlockPos (baritone.api.utils.BetterBlockPos)2