aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0894-Fix-EntityArgument-suggestion-permissions-to-align-w.patch
diff options
context:
space:
mode:
authorJake Potrebic <[email protected]>2023-06-12 16:51:45 -0700
committerGitHub <[email protected]>2023-06-12 16:51:45 -0700
commitc287e921a96438964f32f3c4e394d6809e0d06fa (patch)
treefcc826670454d8a8f5547838414583ce5f1df02d /patches/server/0894-Fix-EntityArgument-suggestion-permissions-to-align-w.patch
parentb48e2e352e21c56d6a9e90bb8d9e548d3658a691 (diff)
downloadPaper-c287e921a96438964f32f3c4e394d6809e0d06fa.tar.gz
Paper-c287e921a96438964f32f3c4e394d6809e0d06fa.zip
Updated Upstream (Bukkit/CraftBukkit/Spigot) (#9301)1.20
Diffstat (limited to 'patches/server/0894-Fix-EntityArgument-suggestion-permissions-to-align-w.patch')
-rw-r--r--patches/server/0894-Fix-EntityArgument-suggestion-permissions-to-align-w.patch28
1 files changed, 28 insertions, 0 deletions
diff --git a/patches/server/0894-Fix-EntityArgument-suggestion-permissions-to-align-w.patch b/patches/server/0894-Fix-EntityArgument-suggestion-permissions-to-align-w.patch
new file mode 100644
index 0000000000..a840f9a576
--- /dev/null
+++ b/patches/server/0894-Fix-EntityArgument-suggestion-permissions-to-align-w.patch
@@ -0,0 +1,28 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Jason Penilla <[email protected]>
+Date: Wed, 26 Oct 2022 13:13:12 -0700
+Subject: [PATCH] Fix EntityArgument suggestion permissions to align with
+ EntitySelector#checkPermissions
+
+Fixes where the user has permission for selectors but not their
+suggestions, which especially matters when we force suggestions to
+the server for this type
+
+diff --git a/src/main/java/net/minecraft/commands/arguments/EntityArgument.java b/src/main/java/net/minecraft/commands/arguments/EntityArgument.java
+index a71726cee91fb406875a4540c9fb7c0ecf757294..150daf6bf4b27a6ff984d872a28002f19beef51c 100644
+--- a/src/main/java/net/minecraft/commands/arguments/EntityArgument.java
++++ b/src/main/java/net/minecraft/commands/arguments/EntityArgument.java
+@@ -128,7 +128,12 @@ public class EntityArgument implements ArgumentType<EntitySelector> {
+ StringReader stringreader = new StringReader(suggestionsbuilder.getInput());
+
+ stringreader.setCursor(suggestionsbuilder.getStart());
+- EntitySelectorParser argumentparserselector = new EntitySelectorParser(stringreader, icompletionprovider.hasPermission(2), true); // Paper
++ // Paper start
++ final boolean permission = object instanceof CommandSourceStack stack
++ ? stack.bypassSelectorPermissions || stack.hasPermission(2, "minecraft.command.selector")
++ : icompletionprovider.hasPermission(2);
++ EntitySelectorParser argumentparserselector = new EntitySelectorParser(stringreader, permission, true); // Paper
++ // Paper end
+
+ try {
+ argumentparserselector.parse();