13
0
geforkt von Mirrors/Paper

net.minecraft.commands.arguments.selector

Dieser Commit ist enthalten in:
Jake Potrebic 2024-12-13 19:46:27 -08:00
Ursprung 9793846a7e
Commit aa7204fd62
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: ECE0B3C133C016C5
3 geänderte Dateien mit 16 neuen und 25 gelöschten Zeilen

Datei anzeigen

@ -1,6 +1,6 @@
--- a/net/minecraft/commands/arguments/selector/EntitySelector.java
+++ b/net/minecraft/commands/arguments/selector/EntitySelector.java
@@ -93,7 +93,7 @@
@@ -105,7 +_,7 @@
}
private void checkPermissions(CommandSourceStack source) throws CommandSyntaxException {

Datei anzeigen

@ -1,24 +1,15 @@
--- a/net/minecraft/commands/arguments/selector/EntitySelectorParser.java
+++ b/net/minecraft/commands/arguments/selector/EntitySelectorParser.java
@@ -133,7 +133,7 @@
boolean flag;
@@ -122,7 +_,7 @@
}
if (source instanceof SharedSuggestionProvider icompletionprovider) {
- if (icompletionprovider.hasPermission(2)) {
+ if (source instanceof net.minecraft.commands.CommandSourceStack stack ? stack.bypassSelectorPermissions || stack.hasPermission(2, "minecraft.command.selector") : icompletionprovider.hasPermission(2)) { // Paper - Fix EntityArgument permissions
flag = true;
return flag;
}
@@ -158,7 +158,7 @@
axisalignedbb = this.createAabb(this.deltaX == null ? 0.0D : this.deltaX, this.deltaY == null ? 0.0D : this.deltaY, this.deltaZ == null ? 0.0D : this.deltaZ);
}
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
}
- Function function;
+ Function<Vec3, Vec3> function; // CraftBukkit - decompile error
if (this.x == null && this.y == null && this.z == null) {
function = (vec3d) -> {
@@ -215,8 +215,10 @@
public EntitySelector getSelector() {
@@ -198,8 +_,10 @@
};
}
@ -30,8 +21,8 @@
+ // CraftBukkit end
this.suggestions = this::suggestSelector;
if (!this.reader.canRead()) {
throw EntitySelectorParser.ERROR_MISSING_SELECTOR_TYPE.createWithContext(this.reader);
@@ -505,6 +507,12 @@
throw ERROR_MISSING_SELECTOR_TYPE.createWithContext(this.reader);
@@ -467,6 +_,12 @@
}
public EntitySelector parse() throws CommandSyntaxException {
@ -44,7 +35,7 @@
this.startPosition = this.reader.getCursor();
this.suggestions = this::suggestNameOrSelector;
if (this.reader.canRead() && this.reader.peek() == '@') {
@@ -513,7 +521,7 @@
@@ -475,7 +_,7 @@
}
this.reader.skip();

Datei anzeigen

@ -1,10 +1,10 @@
--- a/net/minecraft/commands/arguments/selector/SelectorPattern.java
+++ b/net/minecraft/commands/arguments/selector/SelectorPattern.java
@@ -13,7 +13,7 @@
EntitySelectorParser entitySelectorParser = new EntitySelectorParser(new StringReader(selector), true);
return DataResult.success(new SelectorPattern(selector, entitySelectorParser.parse()));
@@ -13,7 +_,7 @@
EntitySelectorParser entitySelectorParser = new EntitySelectorParser(new StringReader(pattern), true);
return DataResult.success(new SelectorPattern(pattern, entitySelectorParser.parse()));
} catch (CommandSyntaxException var2) {
- return DataResult.error(() -> "Invalid selector component: " + selector + ": " + var2.getMessage());
- return DataResult.error(() -> "Invalid selector component: " + pattern + ": " + var2.getMessage());
+ return DataResult.error(() -> "Invalid selector component"); // Paper - limit selector error message
}
}