mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-08 19:34:09 +01:00
30e4583dbe
By: Initial Source <noreply+automated@papermc.io>
38 lines
2 KiB
Diff
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;
|
|
}
|