Clean up some things with DefaultCommands

This commit is contained in:
Brady 2019-09-27 10:18:46 -05:00
parent a04742085e
commit cf60a5f3bd
No known key found for this signature in database
GPG Key ID: 73A788379A197567
2 changed files with 42 additions and 41 deletions

View File

@ -22,48 +22,49 @@ import baritone.api.utils.command.Command;
import java.util.*;
public class DefaultCommands {
public final class DefaultCommands {
public static List<Command> commands(IBaritone baritone) {
private DefaultCommands() {}
public static List<Command> createAll(IBaritone baritone) {
Objects.requireNonNull(baritone);
List<Command> commands = new ArrayList<>();
commands.addAll(Arrays.asList(
new HelpCommand(baritone),
new SetCommand(baritone),
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),
new ProcCommand(baritone),
new VersionCommand(baritone),
new RepackCommand(baritone),
new BuildCommand(baritone),
new SchematicaCommand(baritone),
new ComeCommand(baritone),
new AxisCommand(baritone),
new CancelCommand(baritone),
new ForceCancelCommand(baritone),
new GcCommand(baritone),
new InvertCommand(baritone),
new ClearareaCommand(baritone),
new TunnelCommand(baritone),
new RenderCommand(baritone),
new FarmCommand(baritone),
new ChestsCommand(baritone),
new FollowCommand(baritone),
new ExploreFilterCommand(baritone),
new ReloadAllCommand(baritone),
new SaveAllCommand(baritone),
new ExploreCommand(baritone),
new BlacklistCommand(baritone),
new FindCommand(baritone),
new MineCommand(baritone),
new ClickCommand(baritone),
new ThisWayCommand(baritone),
new WaypointsCommand(baritone),
new CommandAlias(baritone, "sethome", "Sets your home waypoint", "waypoints save home"),
new CommandAlias(baritone, "home", "Set goal to your home waypoint", "waypoints goal home"),
new SelCommand(baritone)
List<Command> commands = new ArrayList<>(Arrays.asList(
new HelpCommand(baritone),
new SetCommand(baritone),
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),
new ProcCommand(baritone),
new VersionCommand(baritone),
new RepackCommand(baritone),
new BuildCommand(baritone),
new SchematicaCommand(baritone),
new ComeCommand(baritone),
new AxisCommand(baritone),
new CancelCommand(baritone),
new ForceCancelCommand(baritone),
new GcCommand(baritone),
new InvertCommand(baritone),
new ClearareaCommand(baritone),
new TunnelCommand(baritone),
new RenderCommand(baritone),
new FarmCommand(baritone),
new ChestsCommand(baritone),
new FollowCommand(baritone),
new ExploreFilterCommand(baritone),
new ReloadAllCommand(baritone),
new SaveAllCommand(baritone),
new ExploreCommand(baritone),
new BlacklistCommand(baritone),
new FindCommand(baritone),
new MineCommand(baritone),
new ClickCommand(baritone),
new ThisWayCommand(baritone),
new WaypointsCommand(baritone),
new CommandAlias(baritone, "sethome", "Sets your home waypoint", "waypoints save home"),
new CommandAlias(baritone, "home", "Set goal to your home waypoint", "waypoints goal home"),
new SelCommand(baritone)
));
PauseResumeCommands prc = new PauseResumeCommands(baritone);
commands.add(prc.pauseCommand);

View File

@ -43,7 +43,7 @@ public class CommandManager implements ICommandManager {
public CommandManager(Baritone baritone) {
this.baritone = baritone;
DefaultCommands.commands(baritone).forEach(this.registry::register);
DefaultCommands.createAll(baritone).forEach(this.registry::register);
}
@Override