mirror of
https://github.com/aikar/commands.git
synced 2026-06-28 01:18:26 +00:00
Fix command routing for forwarding commands
completions still funky, but least get execution working
This commit is contained in:
@@ -138,10 +138,6 @@ class CommandRouter {
|
||||
this(cmd, search.args, search.subcommand, search.commandLabel);
|
||||
}
|
||||
|
||||
CommandRouteResult(CommandRouteResult result, String[] args) {
|
||||
this(result.cmd, args, result.subcommand, result.commandLabel);
|
||||
}
|
||||
|
||||
CommandRouteResult(RegisteredCommand cmd, String[] args, String subcommand, String commandLabel) {
|
||||
this.cmd = cmd;
|
||||
this.args = args;
|
||||
|
||||
@@ -40,6 +40,7 @@ public class ForwardingCommand extends BaseCommand {
|
||||
this.command = baseCommand;
|
||||
this.baseArgs = baseArgs;
|
||||
this.manager = baseCommand.manager;
|
||||
this.subCommands.put(DEFAULT, regCommand);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -79,7 +80,7 @@ public class ForwardingCommand extends BaseCommand {
|
||||
|
||||
@Override
|
||||
public void execute(CommandIssuer issuer, CommandRouter.CommandRouteResult result) {
|
||||
result = new CommandRouter.CommandRouteResult(result, ApacheCommonsLangUtil.addAll(baseArgs, result.args));
|
||||
result = new CommandRouter.CommandRouteResult(regCommand, result.args, ACFUtil.join(baseArgs), result.commandLabel);
|
||||
command.execute(issuer, result);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user