Fixed a bug in redirected contexts, version to 0.1.17
This commit is contained in:
parent
a40cb8869f
commit
6a5289fa33
3 changed files with 5 additions and 2 deletions
|
@ -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) {
|
||||
|
|
|
@ -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()) {
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue