Fixed a bug in redirected contexts, version to 0.1.17
This commit is contained in:
+1
-1
@@ -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.16'
|
version = '0.1.17'
|
||||||
group = 'com.mojang'
|
group = 'com.mojang'
|
||||||
|
|
||||||
task wrapper(type: Wrapper) {
|
task wrapper(type: Wrapper) {
|
||||||
|
|||||||
@@ -108,7 +108,7 @@ public class CommandDispatcher<S> {
|
|||||||
if (next == null) {
|
if (next == null) {
|
||||||
next = new ArrayList<>(1);
|
next = new ArrayList<>(1);
|
||||||
}
|
}
|
||||||
next.add(child);
|
next.add(child.copyFor(context.getSource()));
|
||||||
} else {
|
} else {
|
||||||
final Collection<S> results = modifier.apply(context);
|
final Collection<S> results = modifier.apply(context);
|
||||||
if (!results.isEmpty()) {
|
if (!results.isEmpty()) {
|
||||||
|
|||||||
@@ -30,6 +30,9 @@ public class CommandContext<S> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public CommandContext<S> copyFor(final S source) {
|
public CommandContext<S> copyFor(final S source) {
|
||||||
|
if (this.source == source) {
|
||||||
|
return this;
|
||||||
|
}
|
||||||
return new CommandContext<>(source, input, arguments, command, nodes, range, child, modifier);
|
return new CommandContext<>(source, input, arguments, command, nodes, range, child, modifier);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user