Small fixups

This commit is contained in:
Nassim Jahnke
2024-12-15 12:13:09 +01:00
parent 171fb2ec07
commit 4c723932f6
3 changed files with 22 additions and 25 deletions

View File

@@ -1,14 +1,17 @@
--- a/net/minecraft/commands/arguments/selector/EntitySelectorParser.java
+++ b/net/minecraft/commands/arguments/selector/EntitySelectorParser.java
@@ -122,7 +_,7 @@
@@ -122,6 +_,11 @@
}
public static <S> boolean allowSelectors(S suggestionProvider) {
- return suggestionProvider instanceof SharedSuggestionProvider sharedSuggestionProvider && sharedSuggestionProvider.hasPermission(2);
+ return suggestionProvider instanceof net.minecraft.commands.CommandSourceStack stack ? stack.bypassSelectorPermissions || stack.hasPermission(2, "minecraft.command.selector") : suggestionProvider instanceof net.minecraft.commands.SharedSuggestionProvider sharedSuggestionProvider && sharedSuggestionProvider.hasPermission(2); // Paper - Fix EntityArgument permissions
+ // Paper start - Fix EntityArgument permissions
+ if (suggestionProvider instanceof net.minecraft.commands.CommandSourceStack stack) {
+ return stack.bypassSelectorPermissions || stack.hasPermission(2, "minecraft.command.selector");
+ }
+ // Paper end - Fix EntityArgument permissions
return suggestionProvider instanceof SharedSuggestionProvider sharedSuggestionProvider && sharedSuggestionProvider.hasPermission(2);
}
public EntitySelector getSelector() {
@@ -198,8 +_,10 @@
};
}