MCPcopy Create free account
hub / github.com/cabaletta/baritone / Command

Class Command

src/api/java/baritone/api/command/Command.java:40–67  ·  view source on GitHub ↗

A default implementation of ICommand which provides easy access to the command's bound IBaritone instance, IPlayerContext and an easy way to provide multiple valid command execution names through the default constructor. So basically, you should use it because it provides

Source from the content-addressed store, hash-verified

38 * @see ICommand
39 */
40public abstract class Command implements ICommand {
41
42 protected IBaritone baritone;
43 protected IPlayerContext ctx;
44
45 /**
46 * The names of this command. This is what you put after the command prefix.
47 */
48 protected final List<String> names;
49
50 /**
51 * Creates a new Baritone control command.
52 *
53 * @param names The names of this command. This is what you put after the command prefix.
54 */
55 protected Command(IBaritone baritone, String... names) {
56 this.names = Collections.unmodifiableList(Stream.of(names)
57 .map(s -> s.toLowerCase(Locale.US))
58 .collect(Collectors.toList()));
59 this.baritone = baritone;
60 this.ctx = baritone.getPlayerContext();
61 }
62
63 @Override
64 public final List<String> getNames() {
65 return this.names;
66 }
67}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected