Clean up some things with DefaultCommands
This commit is contained in:
parent
a04742085e
commit
cf60a5f3bd
@ -22,12 +22,13 @@ import baritone.api.utils.command.Command;
|
|||||||
|
|
||||||
import java.util.*;
|
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);
|
Objects.requireNonNull(baritone);
|
||||||
List<Command> commands = new ArrayList<>();
|
List<Command> commands = new ArrayList<>(Arrays.asList(
|
||||||
commands.addAll(Arrays.asList(
|
|
||||||
new HelpCommand(baritone),
|
new HelpCommand(baritone),
|
||||||
new SetCommand(baritone),
|
new SetCommand(baritone),
|
||||||
new CommandAlias(baritone, Arrays.asList("modified", "mod", "baritone", "modifiedsettings"), "List modified settings", "set modified"),
|
new CommandAlias(baritone, Arrays.asList("modified", "mod", "baritone", "modifiedsettings"), "List modified settings", "set modified"),
|
||||||
|
@ -43,7 +43,7 @@ public class CommandManager implements ICommandManager {
|
|||||||
|
|
||||||
public CommandManager(Baritone baritone) {
|
public CommandManager(Baritone baritone) {
|
||||||
this.baritone = baritone;
|
this.baritone = baritone;
|
||||||
DefaultCommands.commands(baritone).forEach(this.registry::register);
|
DefaultCommands.createAll(baritone).forEach(this.registry::register);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
x
Reference in New Issue
Block a user