Don't stop when a forked command failed

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

View file

@ -3,7 +3,7 @@ import groovy.io.FileType
apply plugin: 'java-library' apply plugin: 'java-library'
apply plugin: 'maven' apply plugin: 'maven'
version = '0.1.14' version = '0.1.15'
group = 'com.mojang' group = 'com.mojang'
task wrapper(type: Wrapper) { task wrapper(type: Wrapper) {

View file

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