geforkt von Mirrors/Paper
net.minecraft.commands.arguments.selector
Dieser Commit ist enthalten in:
Ursprung
9793846a7e
Commit
aa7204fd62
@ -1,6 +1,6 @@
|
|||||||
--- a/net/minecraft/commands/arguments/selector/EntitySelector.java
|
--- a/net/minecraft/commands/arguments/selector/EntitySelector.java
|
||||||
+++ b/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 {
|
private void checkPermissions(CommandSourceStack source) throws CommandSyntaxException {
|
@ -1,24 +1,15 @@
|
|||||||
--- a/net/minecraft/commands/arguments/selector/EntitySelectorParser.java
|
--- a/net/minecraft/commands/arguments/selector/EntitySelectorParser.java
|
||||||
+++ b/net/minecraft/commands/arguments/selector/EntitySelectorParser.java
|
+++ b/net/minecraft/commands/arguments/selector/EntitySelectorParser.java
|
||||||
@@ -133,7 +133,7 @@
|
@@ -122,7 +_,7 @@
|
||||||
boolean flag;
|
}
|
||||||
|
|
||||||
if (source instanceof SharedSuggestionProvider icompletionprovider) {
|
public static <S> boolean allowSelectors(S suggestionProvider) {
|
||||||
- if (icompletionprovider.hasPermission(2)) {
|
- return suggestionProvider instanceof SharedSuggestionProvider sharedSuggestionProvider && sharedSuggestionProvider.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
|
+ 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
|
||||||
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);
|
|
||||||
}
|
|
||||||
|
|
||||||
- Function function;
|
public EntitySelector getSelector() {
|
||||||
+ Function<Vec3, Vec3> function; // CraftBukkit - decompile error
|
@@ -198,8 +_,10 @@
|
||||||
|
|
||||||
if (this.x == null && this.y == null && this.z == null) {
|
|
||||||
function = (vec3d) -> {
|
|
||||||
@@ -215,8 +215,10 @@
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -30,8 +21,8 @@
|
|||||||
+ // CraftBukkit end
|
+ // CraftBukkit end
|
||||||
this.suggestions = this::suggestSelector;
|
this.suggestions = this::suggestSelector;
|
||||||
if (!this.reader.canRead()) {
|
if (!this.reader.canRead()) {
|
||||||
throw EntitySelectorParser.ERROR_MISSING_SELECTOR_TYPE.createWithContext(this.reader);
|
throw ERROR_MISSING_SELECTOR_TYPE.createWithContext(this.reader);
|
||||||
@@ -505,6 +507,12 @@
|
@@ -467,6 +_,12 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
public EntitySelector parse() throws CommandSyntaxException {
|
public EntitySelector parse() throws CommandSyntaxException {
|
||||||
@ -44,7 +35,7 @@
|
|||||||
this.startPosition = this.reader.getCursor();
|
this.startPosition = this.reader.getCursor();
|
||||||
this.suggestions = this::suggestNameOrSelector;
|
this.suggestions = this::suggestNameOrSelector;
|
||||||
if (this.reader.canRead() && this.reader.peek() == '@') {
|
if (this.reader.canRead() && this.reader.peek() == '@') {
|
||||||
@@ -513,7 +521,7 @@
|
@@ -475,7 +_,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
this.reader.skip();
|
this.reader.skip();
|
@ -1,10 +1,10 @@
|
|||||||
--- a/net/minecraft/commands/arguments/selector/SelectorPattern.java
|
--- a/net/minecraft/commands/arguments/selector/SelectorPattern.java
|
||||||
+++ b/net/minecraft/commands/arguments/selector/SelectorPattern.java
|
+++ b/net/minecraft/commands/arguments/selector/SelectorPattern.java
|
||||||
@@ -13,7 +13,7 @@
|
@@ -13,7 +_,7 @@
|
||||||
EntitySelectorParser entitySelectorParser = new EntitySelectorParser(new StringReader(selector), true);
|
EntitySelectorParser entitySelectorParser = new EntitySelectorParser(new StringReader(pattern), true);
|
||||||
return DataResult.success(new SelectorPattern(selector, entitySelectorParser.parse()));
|
return DataResult.success(new SelectorPattern(pattern, entitySelectorParser.parse()));
|
||||||
} catch (CommandSyntaxException var2) {
|
} 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
|
+ return DataResult.error(() -> "Invalid selector component"); // Paper - limit selector error message
|
||||||
}
|
}
|
||||||
}
|
}
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren