Some more compilation issues

This commit is contained in:
Bjarne Koll
2025-06-01 17:04:02 +02:00
parent 20136f71ca
commit a1bfc19ab3
24 changed files with 106 additions and 72 deletions

View File

@@ -16,7 +16,7 @@
if (entitySelector.getMaxResults() > 1 && this.single) {
if (this.playersOnly) {
reader.setCursor(0);
@@ -129,7 +_,12 @@
@@ -129,7 +_,13 @@
if (context.getSource() instanceof SharedSuggestionProvider sharedSuggestionProvider) {
StringReader stringReader = new StringReader(builder.getInput());
stringReader.setCursor(builder.getStart());
@@ -24,7 +24,8 @@
+ // Paper start - Fix EntityArgument permissions
+ final boolean permission = sharedSuggestionProvider instanceof CommandSourceStack stack
+ ? stack.bypassSelectorPermissions || stack.hasPermission(2, "minecraft.command.selector")
+ : sharedSuggestionProvider.hasPermission(2);
+ // Only CommandSourceStack implements SharedSuggestionProvider. If *somehow* anything else ends up here, try to query its permission level, otherwise yield false.
+ : (sharedSuggestionProvider instanceof final net.minecraft.commands.PermissionSource permissionSource && permissionSource.hasPermission(2));
+ EntitySelectorParser entitySelectorParser = new EntitySelectorParser(stringReader, permission);
+ // Paper end - Fix EntityArgument permissions