no more asList static
This commit is contained in:
parent
2870d2d69e
commit
f0c78751bf
@ -21,8 +21,6 @@ import baritone.api.utils.BetterBlockPos;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import static java.util.Arrays.asList;
|
||||
|
||||
/**
|
||||
* A marker for a position in the world.
|
||||
*
|
||||
@ -129,7 +127,7 @@ public interface IWaypoint {
|
||||
Set<String> names = new HashSet<>();
|
||||
|
||||
for (Tag tag : Tag.values()) {
|
||||
names.addAll(asList(tag.names));
|
||||
names.addAll(Arrays.asList(tag.names));
|
||||
}
|
||||
|
||||
return names.toArray(new String[0]);
|
||||
|
@ -24,8 +24,6 @@ import net.minecraft.item.ItemStack;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import static java.util.Arrays.asList;
|
||||
|
||||
public class BlockOptionalMetaLookup {
|
||||
|
||||
private final BlockOptionalMeta[] boms;
|
||||
@ -83,7 +81,7 @@ public class BlockOptionalMetaLookup {
|
||||
}
|
||||
|
||||
public List<BlockOptionalMeta> blocks() {
|
||||
return asList(boms);
|
||||
return Arrays.asList(boms);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -25,8 +25,6 @@ import net.minecraft.util.text.TextFormatting;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
import static java.util.Arrays.asList;
|
||||
|
||||
/**
|
||||
* @author Brady
|
||||
* @since 8/1/2018
|
||||
@ -75,7 +73,7 @@ public interface Helper {
|
||||
ITextComponent component = new TextComponentString("");
|
||||
component.appendSibling(getPrefix());
|
||||
component.appendSibling(new TextComponentString(" "));
|
||||
asList(components).forEach(component::appendSibling);
|
||||
Arrays.asList(components).forEach(component::appendSibling);
|
||||
Minecraft.getMinecraft().addScheduledTask(() -> BaritoneAPI.getSettings().logger.value.accept(component));
|
||||
}
|
||||
|
||||
|
@ -19,11 +19,10 @@ package baritone.api.utils.command.argparser;
|
||||
|
||||
import baritone.api.utils.command.argument.CommandArgument;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
import static java.util.Arrays.asList;
|
||||
|
||||
public class DefaultArgParsers {
|
||||
|
||||
public static class IntArgumentParser extends ArgParser<Integer> implements IArgParser.Stateless<Integer> {
|
||||
@ -93,8 +92,8 @@ public class DefaultArgParsers {
|
||||
public static class BooleanArgumentParser extends ArgParser<Boolean> implements IArgParser.Stateless<Boolean> {
|
||||
|
||||
public static final BooleanArgumentParser INSTANCE = new BooleanArgumentParser();
|
||||
public static final List<String> TRUTHY_VALUES = asList("1", "true", "yes", "t", "y", "on", "enable");
|
||||
public static final List<String> FALSY_VALUES = asList("0", "false", "no", "f", "n", "off", "disable");
|
||||
public static final List<String> TRUTHY_VALUES = Arrays.asList("1", "true", "yes", "t", "y", "on", "enable");
|
||||
public static final List<String> FALSY_VALUES = Arrays.asList("0", "false", "no", "f", "n", "off", "disable");
|
||||
|
||||
public BooleanArgumentParser() {
|
||||
super(Boolean.class);
|
||||
@ -113,7 +112,7 @@ public class DefaultArgParsers {
|
||||
}
|
||||
}
|
||||
|
||||
public static final List<ArgParser<?>> ALL = asList(
|
||||
public static final List<ArgParser<?>> ALL = Arrays.asList(
|
||||
IntArgumentParser.INSTANCE,
|
||||
LongArgumentParser.INSTANCE,
|
||||
FloatArgumentParser.INSTANCE,
|
||||
|
@ -23,8 +23,6 @@ import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static java.util.Arrays.asList;
|
||||
|
||||
public class CommandUnhandledException extends CommandErrorMessageException {
|
||||
|
||||
public static String getStackTrace(Throwable throwable) {
|
||||
@ -50,7 +48,7 @@ public class CommandUnhandledException extends CommandErrorMessageException {
|
||||
}
|
||||
|
||||
public static String getFriendlierStackTrace(String stackTrace) {
|
||||
List<String> lines = asList(stackTrace.split("\n"));
|
||||
List<String> lines = Arrays.asList(stackTrace.split("\n"));
|
||||
for (int i = 0; i < lines.size(); i++) {
|
||||
String line = lines.get(i);
|
||||
if (line.startsWith("\tat ")) {
|
||||
|
@ -26,11 +26,10 @@ import net.minecraft.util.text.TextFormatting;
|
||||
import net.minecraft.util.text.event.ClickEvent;
|
||||
import net.minecraft.util.text.event.HoverEvent;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.function.Function;
|
||||
|
||||
import static java.util.Arrays.asList;
|
||||
|
||||
public class Paginator<E> implements Helper {
|
||||
|
||||
public final List<E> entries;
|
||||
@ -42,7 +41,7 @@ public class Paginator<E> implements Helper {
|
||||
}
|
||||
|
||||
public Paginator(E... entries) {
|
||||
this.entries = asList(entries);
|
||||
this.entries = Arrays.asList(entries);
|
||||
}
|
||||
|
||||
public Paginator<E> setPageSize(int pageSize) {
|
||||
@ -143,7 +142,7 @@ public class Paginator<E> implements Helper {
|
||||
}
|
||||
|
||||
public static <T> void paginate(ArgConsumer consumer, T[] elems, Runnable pre, Function<T, ITextComponent> transform, String commandPrefix) {
|
||||
paginate(consumer, asList(elems), pre, transform, commandPrefix);
|
||||
paginate(consumer, Arrays.asList(elems), pre, transform, commandPrefix);
|
||||
}
|
||||
|
||||
public static <T> void paginate(ArgConsumer consumer, Paginator<T> pagi, Function<T, ITextComponent> transform, String commandPrefix) {
|
||||
@ -155,7 +154,7 @@ public class Paginator<E> implements Helper {
|
||||
}
|
||||
|
||||
public static <T> void paginate(ArgConsumer consumer, T[] elems, Function<T, ITextComponent> transform, String commandPrefix) {
|
||||
paginate(consumer, asList(elems), null, transform, commandPrefix);
|
||||
paginate(consumer, Arrays.asList(elems), null, transform, commandPrefix);
|
||||
}
|
||||
|
||||
public static <T> void paginate(ArgConsumer consumer, Paginator<T> pagi, Runnable pre, Function<T, ITextComponent> transform) {
|
||||
@ -167,7 +166,7 @@ public class Paginator<E> implements Helper {
|
||||
}
|
||||
|
||||
public static <T> void paginate(ArgConsumer consumer, T[] elems, Runnable pre, Function<T, ITextComponent> transform) {
|
||||
paginate(consumer, asList(elems), pre, transform, null);
|
||||
paginate(consumer, Arrays.asList(elems), pre, transform, null);
|
||||
}
|
||||
|
||||
public static <T> void paginate(ArgConsumer consumer, Paginator<T> pagi, Function<T, ITextComponent> transform) {
|
||||
@ -179,6 +178,6 @@ public class Paginator<E> implements Helper {
|
||||
}
|
||||
|
||||
public static <T> void paginate(ArgConsumer consumer, T[] elems, Function<T, ITextComponent> transform) {
|
||||
paginate(consumer, asList(elems), null, transform, null);
|
||||
paginate(consumer, Arrays.asList(elems), null, transform, null);
|
||||
}
|
||||
}
|
||||
|
@ -24,15 +24,14 @@ import baritone.api.pathing.goals.GoalAxis;
|
||||
import baritone.api.utils.command.Command;
|
||||
import baritone.api.utils.command.helpers.arguments.ArgConsumer;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import static java.util.Arrays.asList;
|
||||
|
||||
public class AxisCommand extends Command {
|
||||
|
||||
public AxisCommand(IBaritone baritone) {
|
||||
super(baritone, asList("axis", "highway"));
|
||||
super(baritone, Arrays.asList("axis", "highway"));
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -55,7 +54,7 @@ public class AxisCommand extends Command {
|
||||
|
||||
@Override
|
||||
public List<String> getLongDesc() {
|
||||
return asList(
|
||||
return Arrays.asList(
|
||||
"The axis command sets a goal that tells Baritone to head towards the nearest axis. That is, X=0 or Z=0.",
|
||||
"",
|
||||
"Usage:",
|
||||
|
@ -24,11 +24,10 @@ import baritone.api.utils.command.Command;
|
||||
import baritone.api.utils.command.exception.CommandInvalidStateException;
|
||||
import baritone.api.utils.command.helpers.arguments.ArgConsumer;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import static java.util.Arrays.asList;
|
||||
|
||||
public class BlacklistCommand extends Command {
|
||||
|
||||
public BlacklistCommand(IBaritone baritone) {
|
||||
@ -61,7 +60,7 @@ public class BlacklistCommand extends Command {
|
||||
|
||||
@Override
|
||||
public List<String> getLongDesc() {
|
||||
return asList(
|
||||
return Arrays.asList(
|
||||
"While, for example, mining, this command blacklists the closest block so that Baritone won't attempt to get to it.",
|
||||
"",
|
||||
"Usage:",
|
||||
|
@ -28,12 +28,11 @@ import baritone.api.utils.command.helpers.arguments.ArgConsumer;
|
||||
import net.minecraft.client.Minecraft;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import static java.util.Arrays.asList;
|
||||
|
||||
public class BuildCommand extends Command {
|
||||
|
||||
private static final File schematicsDir = new File(Minecraft.getMinecraft().gameDir, "schematics");
|
||||
@ -82,7 +81,7 @@ public class BuildCommand extends Command {
|
||||
|
||||
@Override
|
||||
public List<String> getLongDesc() {
|
||||
return asList(
|
||||
return Arrays.asList(
|
||||
"Build a schematic from a file.",
|
||||
"",
|
||||
"Usage:",
|
||||
|
@ -22,15 +22,14 @@ import baritone.api.Settings;
|
||||
import baritone.api.utils.command.Command;
|
||||
import baritone.api.utils.command.helpers.arguments.ArgConsumer;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import static java.util.Arrays.asList;
|
||||
|
||||
public class CancelCommand extends Command {
|
||||
|
||||
public CancelCommand(IBaritone baritone) {
|
||||
super(baritone, asList("cancel", "stop"));
|
||||
super(baritone, Arrays.asList("cancel", "stop"));
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -52,7 +51,7 @@ public class CancelCommand extends Command {
|
||||
|
||||
@Override
|
||||
public List<String> getLongDesc() {
|
||||
return asList(
|
||||
return Arrays.asList(
|
||||
"The cancel command tells Baritons to stop whatever it's currently doing.",
|
||||
"",
|
||||
"Usage:",
|
||||
|
@ -28,13 +28,12 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import static java.util.Arrays.asList;
|
||||
|
||||
public class ChestsCommand extends Command {
|
||||
|
||||
public ChestsCommand(IBaritone baritone) {
|
||||
@ -74,7 +73,7 @@ public class ChestsCommand extends Command {
|
||||
|
||||
@Override
|
||||
public List<String> getLongDesc() {
|
||||
return asList(
|
||||
return Arrays.asList(
|
||||
"The chests command lists remembered inventories, I guess?",
|
||||
"",
|
||||
"Usage:",
|
||||
|
@ -27,11 +27,10 @@ import baritone.api.utils.command.datatypes.RelativeBlockPos;
|
||||
import baritone.api.utils.command.exception.CommandInvalidStateException;
|
||||
import baritone.api.utils.command.helpers.arguments.ArgConsumer;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import static java.util.Arrays.asList;
|
||||
|
||||
public class ClearareaCommand extends Command {
|
||||
|
||||
public ClearareaCommand(IBaritone baritone) {
|
||||
@ -70,7 +69,7 @@ public class ClearareaCommand extends Command {
|
||||
|
||||
@Override
|
||||
public List<String> getLongDesc() {
|
||||
return asList(
|
||||
return Arrays.asList(
|
||||
"Clear an area of all blocks.",
|
||||
"",
|
||||
"Usage:",
|
||||
|
@ -22,11 +22,10 @@ import baritone.api.Settings;
|
||||
import baritone.api.utils.command.Command;
|
||||
import baritone.api.utils.command.helpers.arguments.ArgConsumer;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import static java.util.Arrays.asList;
|
||||
|
||||
public class ClickCommand extends Command {
|
||||
|
||||
public ClickCommand(IBaritone baritone) {
|
||||
@ -52,7 +51,7 @@ public class ClickCommand extends Command {
|
||||
|
||||
@Override
|
||||
public List<String> getLongDesc() {
|
||||
return asList(
|
||||
return Arrays.asList(
|
||||
"Opens click dude",
|
||||
"",
|
||||
"Usage:",
|
||||
|
@ -26,11 +26,10 @@ import baritone.api.utils.command.helpers.arguments.ArgConsumer;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import static java.util.Arrays.asList;
|
||||
|
||||
public class ComeCommand extends Command {
|
||||
|
||||
public ComeCommand(IBaritone baritone) {
|
||||
@ -60,7 +59,7 @@ public class ComeCommand extends Command {
|
||||
|
||||
@Override
|
||||
public List<String> getLongDesc() {
|
||||
return asList(
|
||||
return Arrays.asList(
|
||||
"The come command tells Baritone to head towards your camera.",
|
||||
"",
|
||||
"This can be useful in hacked clients where freecam doesn't move your player position.",
|
||||
|
@ -22,8 +22,6 @@ import baritone.api.utils.command.Command;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import static java.util.Arrays.asList;
|
||||
|
||||
public class DefaultCommands {
|
||||
|
||||
public static List<Command> commands(IBaritone baritone) {
|
||||
@ -32,7 +30,7 @@ public class DefaultCommands {
|
||||
commands.addAll(Arrays.asList(
|
||||
new HelpCommand(baritone),
|
||||
new SetCommand(baritone),
|
||||
new CommandAlias(baritone, asList("modified", "mod", "baritone", "modifiedsettings"), "List modified settings", "set modified"),
|
||||
new CommandAlias(baritone, Arrays.asList("modified", "mod", "baritone", "modifiedsettings"), "List modified settings", "set modified"),
|
||||
new CommandAlias(baritone, "reset", "Reset all settings or just one", "set reset"),
|
||||
new GoalCommand(baritone),
|
||||
new PathCommand(baritone),
|
||||
|
@ -22,15 +22,14 @@ import baritone.api.Settings;
|
||||
import baritone.api.utils.command.Command;
|
||||
import baritone.api.utils.command.helpers.arguments.ArgConsumer;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import static java.util.Arrays.asList;
|
||||
|
||||
public class EmptyCommand extends Command {
|
||||
|
||||
public EmptyCommand(IBaritone baritone) {
|
||||
super(baritone, asList("name1", "name2"));
|
||||
super(baritone, Arrays.asList("name1", "name2"));
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -50,7 +49,7 @@ public class EmptyCommand extends Command {
|
||||
|
||||
@Override
|
||||
public List<String> getLongDesc() {
|
||||
return asList(
|
||||
return Arrays.asList(
|
||||
"",
|
||||
"",
|
||||
"Usage:",
|
||||
|
@ -24,11 +24,10 @@ import baritone.api.utils.command.Command;
|
||||
import baritone.api.utils.command.datatypes.RelativeGoalXZ;
|
||||
import baritone.api.utils.command.helpers.arguments.ArgConsumer;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import static java.util.Arrays.asList;
|
||||
|
||||
public class ExploreCommand extends Command {
|
||||
|
||||
public ExploreCommand(IBaritone baritone) {
|
||||
@ -64,7 +63,7 @@ public class ExploreCommand extends Command {
|
||||
|
||||
@Override
|
||||
public List<String> getLongDesc() {
|
||||
return asList(
|
||||
return Arrays.asList(
|
||||
"Tell Baritone to explore randomly. If you used explorefilter before this, it will be applied.",
|
||||
"",
|
||||
"Usage:",
|
||||
|
@ -28,11 +28,10 @@ import com.google.gson.JsonSyntaxException;
|
||||
|
||||
import java.io.File;
|
||||
import java.nio.file.NoSuchFileException;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import static java.util.Arrays.asList;
|
||||
|
||||
public class ExploreFilterCommand extends Command {
|
||||
|
||||
public ExploreFilterCommand(IBaritone baritone) {
|
||||
@ -78,7 +77,7 @@ public class ExploreFilterCommand extends Command {
|
||||
|
||||
@Override
|
||||
public List<String> getLongDesc() {
|
||||
return asList(
|
||||
return Arrays.asList(
|
||||
"Apply an explore filter before using explore, which tells the explore process which chunks have been explored/not explored.",
|
||||
"",
|
||||
"The JSON file will follow this format: [{\"x\":0,\"z\":0},...]",
|
||||
|
@ -22,11 +22,10 @@ import baritone.api.Settings;
|
||||
import baritone.api.utils.command.Command;
|
||||
import baritone.api.utils.command.helpers.arguments.ArgConsumer;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import static java.util.Arrays.asList;
|
||||
|
||||
public class FarmCommand extends Command {
|
||||
|
||||
public FarmCommand(IBaritone baritone) {
|
||||
@ -52,7 +51,7 @@ public class FarmCommand extends Command {
|
||||
|
||||
@Override
|
||||
public List<String> getLongDesc() {
|
||||
return asList(
|
||||
return Arrays.asList(
|
||||
"The farm command starts farming nearby plants. It harvests mature crops and plants new ones.",
|
||||
"",
|
||||
"Usage:",
|
||||
|
@ -26,11 +26,10 @@ import baritone.api.utils.command.helpers.arguments.ArgConsumer;
|
||||
import net.minecraft.block.Block;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import static java.util.Arrays.asList;
|
||||
|
||||
public class FindCommand extends Command {
|
||||
|
||||
public FindCommand(IBaritone baritone) {
|
||||
@ -71,7 +70,7 @@ public class FindCommand extends Command {
|
||||
|
||||
@Override
|
||||
public List<String> getLongDesc() {
|
||||
return asList(
|
||||
return Arrays.asList(
|
||||
"",
|
||||
"",
|
||||
"Usage:",
|
||||
|
@ -32,15 +32,10 @@ import net.minecraft.entity.EntityLiving;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Objects;
|
||||
import java.util.*;
|
||||
import java.util.function.Predicate;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import static java.util.Arrays.asList;
|
||||
|
||||
public class FollowCommand extends Command {
|
||||
|
||||
public FollowCommand(IBaritone baritone) {
|
||||
@ -126,7 +121,7 @@ public class FollowCommand extends Command {
|
||||
|
||||
@Override
|
||||
public List<String> getLongDesc() {
|
||||
return asList(
|
||||
return Arrays.asList(
|
||||
"The follow command tells Baritone to follow certain kinds of entities.",
|
||||
"",
|
||||
"Usage:",
|
||||
|
@ -23,11 +23,10 @@ import baritone.api.behavior.IPathingBehavior;
|
||||
import baritone.api.utils.command.Command;
|
||||
import baritone.api.utils.command.helpers.arguments.ArgConsumer;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import static java.util.Arrays.asList;
|
||||
|
||||
public class ForceCancelCommand extends Command {
|
||||
|
||||
public ForceCancelCommand(IBaritone baritone) {
|
||||
@ -55,7 +54,7 @@ public class ForceCancelCommand extends Command {
|
||||
|
||||
@Override
|
||||
public List<String> getLongDesc() {
|
||||
return asList(
|
||||
return Arrays.asList(
|
||||
"Like cancel, but more forceful.",
|
||||
"",
|
||||
"Usage:",
|
||||
|
@ -22,11 +22,10 @@ import baritone.api.Settings;
|
||||
import baritone.api.utils.command.Command;
|
||||
import baritone.api.utils.command.helpers.arguments.ArgConsumer;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import static java.util.Arrays.asList;
|
||||
|
||||
public class GcCommand extends Command {
|
||||
|
||||
public GcCommand(IBaritone baritone) {
|
||||
@ -52,7 +51,7 @@ public class GcCommand extends Command {
|
||||
|
||||
@Override
|
||||
public List<String> getLongDesc() {
|
||||
return asList(
|
||||
return Arrays.asList(
|
||||
"Calls System.gc().",
|
||||
"",
|
||||
"Usage:",
|
||||
|
@ -28,11 +28,10 @@ import baritone.api.utils.command.datatypes.RelativeGoal;
|
||||
import baritone.api.utils.command.helpers.arguments.ArgConsumer;
|
||||
import baritone.api.utils.command.helpers.tabcomplete.TabCompleteHelper;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import static java.util.Arrays.asList;
|
||||
|
||||
public class GoalCommand extends Command {
|
||||
|
||||
public GoalCommand(IBaritone baritone) {
|
||||
@ -42,7 +41,7 @@ public class GoalCommand extends Command {
|
||||
@Override
|
||||
protected void executed(String label, ArgConsumer args, Settings settings) {
|
||||
ICustomGoalProcess goalProcess = baritone.getCustomGoalProcess();
|
||||
if (args.has() && asList("reset", "clear", "none").contains(args.peekString())) {
|
||||
if (args.has() && Arrays.asList("reset", "clear", "none").contains(args.peekString())) {
|
||||
args.requireMax(1);
|
||||
if (goalProcess.getGoal() != null) {
|
||||
goalProcess.setGoal(null);
|
||||
@ -87,7 +86,7 @@ public class GoalCommand extends Command {
|
||||
|
||||
@Override
|
||||
public List<String> getLongDesc() {
|
||||
return asList(
|
||||
return Arrays.asList(
|
||||
"The goal command allows you to set or clear Baritone's goal.",
|
||||
"",
|
||||
"Wherever a coordinate is expected, you can use ~ just like in regular Minecraft commands. Or, you can just use regular numbers.",
|
||||
|
@ -31,18 +31,18 @@ import net.minecraft.util.text.TextFormatting;
|
||||
import net.minecraft.util.text.event.ClickEvent;
|
||||
import net.minecraft.util.text.event.HoverEvent;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import static baritone.api.utils.command.BaritoneChatControl.FORCE_COMMAND_PREFIX;
|
||||
import static baritone.api.utils.command.manager.CommandManager.getCommand;
|
||||
import static java.util.Arrays.asList;
|
||||
|
||||
public class HelpCommand extends Command {
|
||||
|
||||
public HelpCommand(IBaritone baritone) {
|
||||
super(baritone, asList("help", "?"));
|
||||
super(baritone, Arrays.asList("help", "?"));
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -113,7 +113,7 @@ public class HelpCommand extends Command {
|
||||
|
||||
@Override
|
||||
public List<String> getLongDesc() {
|
||||
return asList(
|
||||
return Arrays.asList(
|
||||
"Using this command, you can view detailed help information on how to use certain commands of Baritone.",
|
||||
"",
|
||||
"Usage:",
|
||||
|
@ -26,11 +26,10 @@ import baritone.api.utils.command.Command;
|
||||
import baritone.api.utils.command.exception.CommandInvalidStateException;
|
||||
import baritone.api.utils.command.helpers.arguments.ArgConsumer;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import static java.util.Arrays.asList;
|
||||
|
||||
public class InvertCommand extends Command {
|
||||
|
||||
public InvertCommand(IBaritone baritone) {
|
||||
@ -66,7 +65,7 @@ public class InvertCommand extends Command {
|
||||
|
||||
@Override
|
||||
public List<String> getLongDesc() {
|
||||
return asList(
|
||||
return Arrays.asList(
|
||||
"The invert command tells Baritone to head away from the current goal rather than towards it.",
|
||||
"",
|
||||
"Usage:",
|
||||
|
@ -27,11 +27,10 @@ import baritone.api.utils.command.helpers.arguments.ArgConsumer;
|
||||
import baritone.cache.WorldScanner;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import static java.util.Arrays.asList;
|
||||
|
||||
public class MineCommand extends Command {
|
||||
|
||||
public MineCommand(IBaritone baritone) {
|
||||
@ -63,7 +62,7 @@ public class MineCommand extends Command {
|
||||
|
||||
@Override
|
||||
public List<String> getLongDesc() {
|
||||
return asList(
|
||||
return Arrays.asList(
|
||||
"The mine command allows you to tell Baritone to search for and mine individual blocks.",
|
||||
"",
|
||||
"The specified blocks can be ores (which are commonly cached), or any other block.",
|
||||
|
@ -29,15 +29,14 @@ import baritone.api.utils.command.helpers.arguments.ArgConsumer;
|
||||
import baritone.api.utils.command.helpers.tabcomplete.TabCompleteHelper;
|
||||
import baritone.cache.WorldScanner;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import static java.util.Arrays.asList;
|
||||
|
||||
public class PathCommand extends Command {
|
||||
|
||||
public PathCommand(IBaritone baritone) {
|
||||
super(baritone, asList("path", "goto"));
|
||||
super(baritone, Arrays.asList("path", "goto"));
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -82,7 +81,7 @@ public class PathCommand extends Command {
|
||||
|
||||
@Override
|
||||
public List<String> getLongDesc() {
|
||||
return asList(
|
||||
return Arrays.asList(
|
||||
"The path command tells Baritone to head towards the current goal.",
|
||||
"",
|
||||
"Usage:",
|
||||
|
@ -26,11 +26,10 @@ import baritone.api.utils.command.Command;
|
||||
import baritone.api.utils.command.exception.CommandInvalidStateException;
|
||||
import baritone.api.utils.command.helpers.arguments.ArgConsumer;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import static java.util.Arrays.asList;
|
||||
|
||||
/**
|
||||
* Contains the pause, resume, and paused commands.
|
||||
* <p>
|
||||
@ -103,7 +102,7 @@ public class PauseResumeCommands {
|
||||
|
||||
@Override
|
||||
public List<String> getLongDesc() {
|
||||
return asList(
|
||||
return Arrays.asList(
|
||||
"The pause command tells Baritone to temporarily stop whatever it's doing.",
|
||||
"",
|
||||
"This can be used to pause pathing, building, following, whatever. A single use of the resume command will start it right back up again!",
|
||||
@ -136,7 +135,7 @@ public class PauseResumeCommands {
|
||||
|
||||
@Override
|
||||
public List<String> getLongDesc() {
|
||||
return asList(
|
||||
return Arrays.asList(
|
||||
"The resume command tells Baritone to resume whatever it was doing when you last used pause.",
|
||||
"",
|
||||
"Usage:",
|
||||
@ -163,7 +162,7 @@ public class PauseResumeCommands {
|
||||
|
||||
@Override
|
||||
public List<String> getLongDesc() {
|
||||
return asList(
|
||||
return Arrays.asList(
|
||||
"The paused command tells you if Baritone is currently paused by use of the pause command.",
|
||||
"",
|
||||
"Usage:",
|
||||
|
@ -26,11 +26,10 @@ import baritone.api.utils.command.Command;
|
||||
import baritone.api.utils.command.exception.CommandInvalidStateException;
|
||||
import baritone.api.utils.command.helpers.arguments.ArgConsumer;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import static java.util.Arrays.asList;
|
||||
|
||||
public class ProcCommand extends Command {
|
||||
|
||||
public ProcCommand(IBaritone baritone) {
|
||||
@ -74,7 +73,7 @@ public class ProcCommand extends Command {
|
||||
|
||||
@Override
|
||||
public List<String> getLongDesc() {
|
||||
return asList(
|
||||
return Arrays.asList(
|
||||
"The proc command provides miscellaneous information about the process currently controlling Baritone.",
|
||||
"",
|
||||
"You are not expected to understand this if you aren't familiar with how Baritone works.",
|
||||
|
@ -22,11 +22,10 @@ import baritone.api.Settings;
|
||||
import baritone.api.utils.command.Command;
|
||||
import baritone.api.utils.command.helpers.arguments.ArgConsumer;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import static java.util.Arrays.asList;
|
||||
|
||||
public class ReloadAllCommand extends Command {
|
||||
|
||||
public ReloadAllCommand(IBaritone baritone) {
|
||||
@ -52,7 +51,7 @@ public class ReloadAllCommand extends Command {
|
||||
|
||||
@Override
|
||||
public List<String> getLongDesc() {
|
||||
return asList(
|
||||
return Arrays.asList(
|
||||
"The reloadall command reloads Baritone's world cache.",
|
||||
"",
|
||||
"Usage:",
|
||||
|
@ -23,11 +23,10 @@ import baritone.api.utils.BetterBlockPos;
|
||||
import baritone.api.utils.command.Command;
|
||||
import baritone.api.utils.command.helpers.arguments.ArgConsumer;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import static java.util.Arrays.asList;
|
||||
|
||||
public class RenderCommand extends Command {
|
||||
|
||||
public RenderCommand(IBaritone baritone) {
|
||||
@ -62,7 +61,7 @@ public class RenderCommand extends Command {
|
||||
|
||||
@Override
|
||||
public List<String> getLongDesc() {
|
||||
return asList(
|
||||
return Arrays.asList(
|
||||
"The render command fixes glitched chunk rendering without having to reload all of them.",
|
||||
"",
|
||||
"Usage:",
|
||||
|
@ -23,15 +23,14 @@ import baritone.api.utils.command.Command;
|
||||
import baritone.api.utils.command.helpers.arguments.ArgConsumer;
|
||||
import baritone.cache.WorldScanner;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import static java.util.Arrays.asList;
|
||||
|
||||
public class RepackCommand extends Command {
|
||||
|
||||
public RepackCommand(IBaritone baritone) {
|
||||
super(baritone, asList("repack", "rescan"));
|
||||
super(baritone, Arrays.asList("repack", "rescan"));
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -52,7 +51,7 @@ public class RepackCommand extends Command {
|
||||
|
||||
@Override
|
||||
public List<String> getLongDesc() {
|
||||
return asList(
|
||||
return Arrays.asList(
|
||||
"Repack chunks around you. This basically re-caches them.",
|
||||
"",
|
||||
"Usage:",
|
||||
|
@ -22,11 +22,10 @@ import baritone.api.Settings;
|
||||
import baritone.api.utils.command.Command;
|
||||
import baritone.api.utils.command.helpers.arguments.ArgConsumer;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import static java.util.Arrays.asList;
|
||||
|
||||
public class SaveAllCommand extends Command {
|
||||
|
||||
public SaveAllCommand(IBaritone baritone) {
|
||||
@ -52,7 +51,7 @@ public class SaveAllCommand extends Command {
|
||||
|
||||
@Override
|
||||
public List<String> getLongDesc() {
|
||||
return asList(
|
||||
return Arrays.asList(
|
||||
"The saveall command saves Baritone's world cache.",
|
||||
"",
|
||||
"Usage:",
|
||||
|
@ -22,11 +22,10 @@ import baritone.api.Settings;
|
||||
import baritone.api.utils.command.Command;
|
||||
import baritone.api.utils.command.helpers.arguments.ArgConsumer;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import static java.util.Arrays.asList;
|
||||
|
||||
public class SchematicaCommand extends Command {
|
||||
|
||||
public SchematicaCommand(IBaritone baritone) {
|
||||
@ -51,7 +50,7 @@ public class SchematicaCommand extends Command {
|
||||
|
||||
@Override
|
||||
public List<String> getLongDesc() {
|
||||
return asList(
|
||||
return Arrays.asList(
|
||||
"Builds the schematica currently open in Schematica.",
|
||||
"",
|
||||
"Usage:",
|
||||
|
@ -44,22 +44,18 @@ import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.Vec3i;
|
||||
|
||||
import java.awt.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.*;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import static java.util.Arrays.asList;
|
||||
|
||||
public class SelCommand extends Command {
|
||||
|
||||
private ISelectionManager manager = baritone.getSelectionManager();
|
||||
private BetterBlockPos pos1 = null;
|
||||
|
||||
public SelCommand(IBaritone baritone) {
|
||||
super(baritone, asList("sel", "selection", "s"));
|
||||
super(baritone, Arrays.asList("sel", "selection", "s"));
|
||||
baritone.getGameEventHandler().registerEventListener(new AbstractGameEventListener() {
|
||||
@Override
|
||||
public void onRenderPass(RenderEvent event) {
|
||||
@ -236,7 +232,7 @@ public class SelCommand extends Command {
|
||||
|
||||
@Override
|
||||
public List<String> getLongDesc() {
|
||||
return asList(
|
||||
return Arrays.asList(
|
||||
"The sel command allows you to manipulate Baritone's selections, similarly to WorldEdit.",
|
||||
"",
|
||||
"Using these selections, you can clear areas, fill them with blocks, or something else.",
|
||||
@ -296,7 +292,7 @@ public class SelCommand extends Command {
|
||||
public static String[] getAllNames() {
|
||||
Set<String> names = new HashSet<>();
|
||||
for (Action action : Action.values()) {
|
||||
names.addAll(asList(action.names));
|
||||
names.addAll(Arrays.asList(action.names));
|
||||
}
|
||||
return names.toArray(new String[0]);
|
||||
}
|
||||
@ -332,7 +328,7 @@ public class SelCommand extends Command {
|
||||
public static String[] getAllNames() {
|
||||
Set<String> names = new HashSet<>();
|
||||
for (TransformTarget target : TransformTarget.values()) {
|
||||
names.addAll(asList(target.names));
|
||||
names.addAll(Arrays.asList(target.names));
|
||||
}
|
||||
return names.toArray(new String[0]);
|
||||
}
|
||||
|
@ -31,6 +31,7 @@ import net.minecraft.util.text.TextFormatting;
|
||||
import net.minecraft.util.text.event.ClickEvent;
|
||||
import net.minecraft.util.text.event.HoverEvent;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.stream.Collectors;
|
||||
@ -39,25 +40,23 @@ import java.util.stream.Stream;
|
||||
import static baritone.api.utils.SettingsUtil.settingTypeToString;
|
||||
import static baritone.api.utils.SettingsUtil.settingValueToString;
|
||||
import static baritone.api.utils.command.BaritoneChatControl.FORCE_COMMAND_PREFIX;
|
||||
import static java.util.Arrays.asList;
|
||||
import static java.util.stream.Stream.of;
|
||||
|
||||
public class SetCommand extends Command {
|
||||
|
||||
public SetCommand(IBaritone baritone) {
|
||||
super(baritone, asList("set", "setting", "settings"));
|
||||
super(baritone, Arrays.asList("set", "setting", "settings"));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void executed(String label, ArgConsumer args, Settings settings) {
|
||||
String arg = args.has() ? args.getString().toLowerCase(Locale.US) : "list";
|
||||
if (asList("s", "save").contains(arg)) {
|
||||
if (Arrays.asList("s", "save").contains(arg)) {
|
||||
SettingsUtil.save(settings);
|
||||
logDirect("Settings saved");
|
||||
return;
|
||||
}
|
||||
boolean viewModified = asList("m", "mod", "modified").contains(arg);
|
||||
boolean viewAll = asList("all", "l", "list").contains(arg);
|
||||
boolean viewModified = Arrays.asList("m", "mod", "modified").contains(arg);
|
||||
boolean viewAll = Arrays.asList("all", "l", "list").contains(arg);
|
||||
boolean paginate = viewModified || viewAll;
|
||||
if (paginate) {
|
||||
String search = args.has() && args.peekAsOrNull(Integer.class) == null ? args.getString() : "";
|
||||
@ -188,7 +187,7 @@ public class SetCommand extends Command {
|
||||
protected Stream<String> tabCompleted(String label, ArgConsumer args, Settings settings) {
|
||||
if (args.has()) {
|
||||
String arg = args.getString();
|
||||
if (args.hasExactlyOne() && !asList("s", "save").contains(args.peekString().toLowerCase(Locale.US))) {
|
||||
if (args.hasExactlyOne() && !Arrays.asList("s", "save").contains(args.peekString().toLowerCase(Locale.US))) {
|
||||
if (arg.equalsIgnoreCase("reset")) {
|
||||
return new TabCompleteHelper()
|
||||
.addModifiedSettings()
|
||||
@ -206,9 +205,9 @@ public class SetCommand extends Command {
|
||||
if (setting.getType() == Boolean.class) {
|
||||
TabCompleteHelper helper = new TabCompleteHelper();
|
||||
if ((Boolean) setting.value) {
|
||||
helper.append(of("true", "false"));
|
||||
helper.append(Stream.of("true", "false"));
|
||||
} else {
|
||||
helper.append(of("false", "true"));
|
||||
helper.append(Stream.of("false", "true"));
|
||||
}
|
||||
return helper.filterPrefix(args.getString()).stream();
|
||||
} else {
|
||||
@ -234,7 +233,7 @@ public class SetCommand extends Command {
|
||||
|
||||
@Override
|
||||
public List<String> getLongDesc() {
|
||||
return asList(
|
||||
return Arrays.asList(
|
||||
"Using the set command, you can manage all of Baritone's settings. Almost every aspect is controlled by these settings - go wild!",
|
||||
"",
|
||||
"Usage:",
|
||||
|
@ -23,15 +23,14 @@ import baritone.api.pathing.goals.GoalXZ;
|
||||
import baritone.api.utils.command.Command;
|
||||
import baritone.api.utils.command.helpers.arguments.ArgConsumer;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import static java.util.Arrays.asList;
|
||||
|
||||
public class ThisWayCommand extends Command {
|
||||
|
||||
public ThisWayCommand(IBaritone baritone) {
|
||||
super(baritone, asList("thisway", "forward"));
|
||||
super(baritone, Arrays.asList("thisway", "forward"));
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -58,7 +57,7 @@ public class ThisWayCommand extends Command {
|
||||
|
||||
@Override
|
||||
public List<String> getLongDesc() {
|
||||
return asList(
|
||||
return Arrays.asList(
|
||||
"Creates a GoalXZ some amount of blocks in the direction you're currently looking",
|
||||
"",
|
||||
"Usage:",
|
||||
|
@ -24,11 +24,10 @@ import baritone.api.pathing.goals.GoalStrictDirection;
|
||||
import baritone.api.utils.command.Command;
|
||||
import baritone.api.utils.command.helpers.arguments.ArgConsumer;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import static java.util.Arrays.asList;
|
||||
|
||||
public class TunnelCommand extends Command {
|
||||
|
||||
public TunnelCommand(IBaritone baritone) {
|
||||
@ -58,7 +57,7 @@ public class TunnelCommand extends Command {
|
||||
|
||||
@Override
|
||||
public List<String> getLongDesc() {
|
||||
return asList(
|
||||
return Arrays.asList(
|
||||
"The tunnel command sets a goal that tells Baritone to mine completely straight in the direction that you're facing.",
|
||||
"",
|
||||
"Usage:",
|
||||
|
@ -23,11 +23,10 @@ import baritone.api.utils.command.Command;
|
||||
import baritone.api.utils.command.exception.CommandInvalidStateException;
|
||||
import baritone.api.utils.command.helpers.arguments.ArgConsumer;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import static java.util.Arrays.asList;
|
||||
|
||||
public class VersionCommand extends Command {
|
||||
|
||||
public VersionCommand(IBaritone baritone) {
|
||||
@ -57,7 +56,7 @@ public class VersionCommand extends Command {
|
||||
|
||||
@Override
|
||||
public List<String> getLongDesc() {
|
||||
return asList(
|
||||
return Arrays.asList(
|
||||
"The version command prints the version of Baritone you're currently running.",
|
||||
"",
|
||||
"Usage:",
|
||||
|
@ -38,21 +38,17 @@ import net.minecraft.util.text.TextFormatting;
|
||||
import net.minecraft.util.text.event.ClickEvent;
|
||||
import net.minecraft.util.text.event.HoverEvent;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.*;
|
||||
import java.util.function.BiFunction;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import static baritone.api.utils.command.BaritoneChatControl.FORCE_COMMAND_PREFIX;
|
||||
import static java.util.Arrays.asList;
|
||||
|
||||
public class WaypointsCommand extends Command {
|
||||
|
||||
public WaypointsCommand(IBaritone baritone) {
|
||||
super(baritone, asList("waypoints", "waypoint", "wp"));
|
||||
super(baritone, Arrays.asList("waypoints", "waypoint", "wp"));
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -279,7 +275,7 @@ public class WaypointsCommand extends Command {
|
||||
|
||||
@Override
|
||||
public List<String> getLongDesc() {
|
||||
return asList(
|
||||
return Arrays.asList(
|
||||
"The waypoint command allows you to manage Baritone's waypoints.",
|
||||
"",
|
||||
"Waypoints can be used to mark positions for later. Waypoints are each given a tag and an optional name.",
|
||||
@ -324,7 +320,7 @@ public class WaypointsCommand extends Command {
|
||||
public static String[] getAllNames() {
|
||||
Set<String> names = new HashSet<>();
|
||||
for (Action action : Action.values()) {
|
||||
names.addAll(asList(action.names));
|
||||
names.addAll(Arrays.asList(action.names));
|
||||
}
|
||||
return names.toArray(new String[0]);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user