aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0775-Check-requirement-before-suggesting-root-nodes.patch
diff options
context:
space:
mode:
authorShane Freeder <[email protected]>2022-04-30 17:27:41 +0100
committerGitHub <[email protected]>2022-04-30 17:27:41 +0100
commit41666323335e16c3f41ed4ce5bb6be01f90b6a1e (patch)
treecab23fbe6ad98015501159fca0e092f899bf6765 /patches/server/0775-Check-requirement-before-suggesting-root-nodes.patch
parent608482d512bdb0a23e3e25d00bec1bb7e066ed4d (diff)
downloadPaper-41666323335e16c3f41ed4ce5bb6be01f90b6a1e.tar.gz
Paper-41666323335e16c3f41ed4ce5bb6be01f90b6a1e.zip
Updated Upstream (Bukkit/CraftBukkit) (#7776)
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) {
}
+ }