Reinstated returning successfulForks count from execute
This commit is contained in:
parent
f4ea2f6e05
commit
dae8a48993
1 changed files with 3 additions and 1 deletions
|
@ -218,6 +218,7 @@ public class CommandDispatcher<S> {
|
|||
}
|
||||
|
||||
Object result = new EmptyCommandResult();
|
||||
int successfulForks = 0;
|
||||
boolean forked = false;
|
||||
boolean foundCommand = false;
|
||||
final String command = parse.getReader().getString();
|
||||
|
@ -265,6 +266,7 @@ public class CommandDispatcher<S> {
|
|||
final Object value = context.getCommand().run(context);
|
||||
consumer.onCommandComplete(context, true, value);
|
||||
result = CommandResult.combine(result, value);
|
||||
successfulForks++;
|
||||
} catch (final CommandSyntaxException ex) {
|
||||
consumer.onCommandComplete(context, false, new EmptyCommandResult());
|
||||
if (!forked) {
|
||||
|
@ -283,7 +285,7 @@ public class CommandDispatcher<S> {
|
|||
throw CommandSyntaxException.BUILT_IN_EXCEPTIONS.dispatcherUnknownCommand().createWithContext(parse.getReader());
|
||||
}
|
||||
|
||||
return result;
|
||||
return forked ? successfulForks : result;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue