forked from chipmunkmc/chipmunkbot
parent
8765053530
commit
b5d3747410
1 changed files with 7 additions and 6 deletions
|
@ -14,18 +14,19 @@ public class RunCommand extends Command {
|
|||
super();
|
||||
|
||||
this.node(
|
||||
literal("echo")
|
||||
literal("run")
|
||||
.then(
|
||||
argument("text", greedyString())
|
||||
.executes(this::echo)
|
||||
argument("command", greedyString())
|
||||
.executes(this::run)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
public int echo (CommandContext<CommandSource> context) {
|
||||
public int run (CommandContext<CommandSource> context) {
|
||||
final CommandSource source = context.getSource();
|
||||
final String text = getString(context, "command");
|
||||
source.sendOutput(Component.text(text));
|
||||
final ChipmunkBot client = source.client();
|
||||
|
||||
client.core().run(getString(context, "command"));
|
||||
|
||||
return 1;
|
||||
}
|
Loading…
Reference in a new issue