mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-30 19:40:37 +01:00
Fix EntityArgument suggestion permissions to align with EntitySelector#checkPermissions (#8511)
This commit is contained in:
parent
f8cf06b774
commit
731f32f889
1 changed files with 28 additions and 0 deletions
|
@ -0,0 +1,28 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Jason Penilla <11360596+jpenilla@users.noreply.github.com>
|
||||
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 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/commands/arguments/EntityArgument.java
|
||||
+++ b/src/main/java/net/minecraft/commands/arguments/EntityArgument.java
|
||||
@@ -0,0 +0,0 @@ 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.hasPermission(2, "minecraft.command.selector")
|
||||
+ : icompletionprovider.hasPermission(2);
|
||||
+ EntitySelectorParser argumentparserselector = new EntitySelectorParser(stringreader, permission, true); // Paper
|
||||
+ // Paper end
|
||||
|
||||
try {
|
||||
argumentparserselector.parse();
|
Loading…
Add table
Reference in a new issue