Search in sources :

Example 1 with IGetToBlockProcess

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

the class BlacklistCommand method execute.

@Override
public void execute(String label, IArgConsumer args) throws CommandException {
    args.requireMax(0);
    IGetToBlockProcess proc = baritone.getGetToBlockProcess();
    if (!proc.isActive()) {
        throw new CommandInvalidStateException("GetToBlockProcess is not currently active");
    }
    if (proc.blacklistClosest()) {
        logDirect("Blacklisted closest instances");
    } else {
        throw new CommandInvalidStateException("No known locations, unable to blacklist");
    }
}
Also used : IGetToBlockProcess(baritone.api.process.IGetToBlockProcess) CommandInvalidStateException(baritone.api.command.exception.CommandInvalidStateException)

Example 2 with IGetToBlockProcess

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

the class BlacklistCommand method execute.

@Override
public void execute(String label, IArgConsumer args) throws CommandException {
    args.requireMax(0);
    IGetToBlockProcess proc = baritone.getGetToBlockProcess();
    if (!proc.isActive()) {
        throw new CommandInvalidStateException("GetToBlockProcess is not currently active");
    }
    if (proc.blacklistClosest()) {
        logDirect("Blacklisted closest instances");
    } else {
        throw new CommandInvalidStateException("No known locations, unable to blacklist");
    }
}
Also used : IGetToBlockProcess(baritone.api.process.IGetToBlockProcess) CommandInvalidStateException(baritone.api.command.exception.CommandInvalidStateException)

Aggregations

CommandInvalidStateException (baritone.api.command.exception.CommandInvalidStateException)2 IGetToBlockProcess (baritone.api.process.IGetToBlockProcess)2