Don't stop when a forked command failed

This commit is contained in:
Nathan Adams committed 2017-12-12 09:56:02 +01:00
1 parent 4b64169b59
commit 6f04756d34
2 files changed
+2 -5

No files matched your search

@@ -101,12 +101,9 @@ public class CommandDispatcher<S> {
final CommandContext<S> context = builder.build(parse.getReader().getString());
if (child != null) {
if (!child.getNodes().isEmpty()) {
foundCommand = true;
final RedirectModifier<S> modifier = Iterators.getLast(builder.getNodes().keySet().iterator()).getRedirectModifier();
final Collection<S> results = modifier.apply(context);
if (results.isEmpty()) {
consumer.onCommandComplete(context, false, 0);
return 0;
}
if (results.size() > 1) {
forked = true;
}