revert echo command
This commit is contained in:
Chipmunk 2023-01-19 18:46:03 -05:00
parent 8765053530
commit b5d3747410

View file

@ -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;
}