aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0775-Check-requirement-before-suggesting-root-nodes.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patches/server/0775-Check-requirement-before-suggesting-root-nodes.patch')
-rw-r--r--patches/server/0775-Check-requirement-before-suggesting-root-nodes.patch7
1 files changed, 4 insertions, 3 deletions
diff --git a/patches/server/0775-Check-requirement-before-suggesting-root-nodes.patch b/patches/server/0775-Check-requirement-before-suggesting-root-nodes.patch
index da19d3f1ca..d824c5f2af 100644
--- a/patches/server/0775-Check-requirement-before-suggesting-root-nodes.patch
+++ b/patches/server/0775-Check-requirement-before-suggesting-root-nodes.patch
@@ -11,17 +11,18 @@ encountering a command node with ASK_SERVER suggestions, however a
modified client can send this packet whenever it wants.
diff --git a/src/main/java/com/mojang/brigadier/CommandDispatcher.java b/src/main/java/com/mojang/brigadier/CommandDispatcher.java
-index ca24830bac1a04b798229d1946863429c7849495..5584040fe48c18aa809f5a1510157e735851df79 100644
+index e733a5657032d29e5a0d64375c9e36639360a7e0..b64c98c173e25055f4ff9d7124d0a3cb7ff6ab1d 100644
--- a/src/main/java/com/mojang/brigadier/CommandDispatcher.java
+++ b/src/main/java/com/mojang/brigadier/CommandDispatcher.java
-@@ -594,10 +594,14 @@ public class CommandDispatcher<S> {
+@@ -595,10 +595,14 @@ public class CommandDispatcher<S> {
int i = 0;
for (final CommandNode<S> node : parent.getChildren()) {
CompletableFuture<Suggestions> future = Suggestions.empty();
+ // Paper start - Don't suggest if the requirement isn't met
+ if (parent != this.root || node.canUse(context.getSource())) {
try {
- future = node.listSuggestions(context.build(truncatedInput), new SuggestionsBuilder(truncatedInput, truncatedInputLowerCase, start));
+- if (node.canUse(parse.getContext().getSource())) future = node.listSuggestions(context.build(truncatedInput), new SuggestionsBuilder(truncatedInput, truncatedInputLowerCase, start)); // CraftBukkit
++ future = node.listSuggestions(context.build(truncatedInput), new SuggestionsBuilder(truncatedInput, truncatedInputLowerCase, start)); // CraftBukkit
} catch (final CommandSyntaxException ignored) {
}
+ }