Fixed a bug in redirected contexts, version to 0.1.17

This commit is contained in:
Nathan Adams 2018-01-16 15:14:30 +01:00
parent a40cb8869f
commit 6a5289fa33
3 changed files with 5 additions and 2 deletions

View file

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

View file

@ -108,7 +108,7 @@ public class CommandDispatcher<S> {
if (next == null) {
next = new ArrayList<>(1);
}
next.add(child);
next.add(child.copyFor(context.getSource()));
} else {
final Collection<S> results = modifier.apply(context);
if (!results.isEmpty()) {

View file

@ -30,6 +30,9 @@ public class CommandContext<S> {
}
public CommandContext<S> copyFor(final S source) {
if (this.source == source) {
return this;
}
return new CommandContext<>(source, input, arguments, command, nodes, range, child, modifier);
}