PaperMC/paper-server/patches/sources/net/minecraft/commands/arguments/EntityArgument.java.patch
CraftBukkit/Spigot 30e4583dbe Remap CraftBukkit to Mojang+Yarn Mappings
By: Initial Source <noreply+automated@papermc.io>
2024-12-11 22:26:55 +01:00

38 lines
2 KiB
Diff

--- a/net/minecraft/commands/arguments/EntityArgument.java
+++ b/net/minecraft/commands/arguments/EntityArgument.java
@@ -102,21 +102,27 @@
}
private EntitySelector parse(StringReader reader, boolean allowAtSelectors) throws CommandSyntaxException {
+ // CraftBukkit start
+ return this.parse(reader, allowAtSelectors, false);
+ }
+
+ public EntitySelector parse(StringReader stringreader, boolean flag, boolean overridePermissions) throws CommandSyntaxException {
+ // CraftBukkit end
boolean flag1 = false;
- EntitySelectorParser argumentparserselector = new EntitySelectorParser(reader, allowAtSelectors);
- EntitySelector entityselector = argumentparserselector.parse();
+ EntitySelectorParser argumentparserselector = new EntitySelectorParser(stringreader, flag);
+ EntitySelector entityselector = argumentparserselector.parse(overridePermissions); // CraftBukkit
if (entityselector.getMaxResults() > 1 && this.single) {
if (this.playersOnly) {
- reader.setCursor(0);
- throw EntityArgument.ERROR_NOT_SINGLE_PLAYER.createWithContext(reader);
+ stringreader.setCursor(0);
+ throw EntityArgument.ERROR_NOT_SINGLE_PLAYER.createWithContext(stringreader);
} else {
- reader.setCursor(0);
- throw EntityArgument.ERROR_NOT_SINGLE_ENTITY.createWithContext(reader);
+ stringreader.setCursor(0);
+ throw EntityArgument.ERROR_NOT_SINGLE_ENTITY.createWithContext(stringreader);
}
} else if (entityselector.includesEntities() && this.playersOnly && !entityselector.isSelfSelector()) {
- reader.setCursor(0);
- throw EntityArgument.ERROR_ONLY_PLAYERS_ALLOWED.createWithContext(reader);
+ stringreader.setCursor(0);
+ throw EntityArgument.ERROR_ONLY_PLAYERS_ALLOWED.createWithContext(stringreader);
} else {
return entityselector;
}