@@ -0,0 +1,19 @@
|
||||
--- a/net/minecraft/server/ArgumentEntity.java
|
||||
+++ b/net/minecraft/server/ArgumentEntity.java
|
||||
@@ -84,9 +84,15 @@
|
||||
}
|
||||
|
||||
public EntitySelector parse(StringReader stringreader) throws CommandSyntaxException {
|
||||
+ // CraftBukkit start
|
||||
+ return parse(stringreader, false);
|
||||
+ }
|
||||
+
|
||||
+ public EntitySelector parse(StringReader stringreader, boolean overridePermissions) throws CommandSyntaxException {
|
||||
+ // CraftBukkit end
|
||||
boolean flag = false;
|
||||
ArgumentParserSelector argumentparserselector = new ArgumentParserSelector(stringreader);
|
||||
- EntitySelector entityselector = argumentparserselector.parse();
|
||||
+ EntitySelector entityselector = argumentparserselector.parse(overridePermissions); // CraftBukkit
|
||||
|
||||
if (entityselector.a() > 1 && this.h) {
|
||||
if (this.i) {
|
||||
@@ -0,0 +1,38 @@
|
||||
--- a/net/minecraft/server/ArgumentBlock.java
|
||||
+++ b/net/minecraft/server/ArgumentBlock.java
|
||||
@@ -43,7 +43,7 @@
|
||||
};
|
||||
private final StringReader i;
|
||||
private final boolean j;
|
||||
- private final Map<IBlockState<?>, Comparable<?>> k = Maps.newHashMap();
|
||||
+ private final Map<IBlockState<?>, Comparable<?>> k = Maps.newLinkedHashMap(); // CraftBukkit - stable
|
||||
private final Map<String, String> l = Maps.newHashMap();
|
||||
private MinecraftKey m = new MinecraftKey("");
|
||||
private BlockStateList<Block, IBlockData> n;
|
||||
@@ -219,7 +219,7 @@
|
||||
Iterator iterator = iblockstate.getValues().iterator();
|
||||
|
||||
while (iterator.hasNext()) {
|
||||
- T t0 = (Comparable) iterator.next();
|
||||
+ T t0 = (T) iterator.next(); // CraftBukkit - decompile error
|
||||
|
||||
if (t0 instanceof Integer) {
|
||||
suggestionsbuilder.suggest((Integer) t0);
|
||||
@@ -488,7 +488,7 @@
|
||||
Optional<T> optional = iblockstate.b(s);
|
||||
|
||||
if (optional.isPresent()) {
|
||||
- this.o = (IBlockData) this.o.set(iblockstate, (Comparable) optional.get());
|
||||
+ this.o = (IBlockData) this.o.set(iblockstate, (T) optional.get()); // CraftBukkit - decompile error
|
||||
this.k.put(iblockstate, optional.get());
|
||||
} else {
|
||||
this.i.setCursor(i);
|
||||
@@ -522,7 +522,7 @@
|
||||
private static <T extends Comparable<T>> void a(StringBuilder stringbuilder, IBlockState<T> iblockstate, Comparable<?> comparable) {
|
||||
stringbuilder.append(iblockstate.getName());
|
||||
stringbuilder.append('=');
|
||||
- stringbuilder.append(iblockstate.a(comparable));
|
||||
+ stringbuilder.append(iblockstate.a((T) comparable)); // CraftBukkit - decompile error
|
||||
}
|
||||
|
||||
public CompletableFuture<Suggestions> a(SuggestionsBuilder suggestionsbuilder, Tags<Block> tags) {
|
||||
@@ -0,0 +1,46 @@
|
||||
--- a/net/minecraft/server/ArgumentParserSelector.java
|
||||
+++ b/net/minecraft/server/ArgumentParserSelector.java
|
||||
@@ -127,7 +127,7 @@
|
||||
axisalignedbb = this.a(this.v == null ? 0.0D : this.v, this.w == null ? 0.0D : this.w, this.x == null ? 0.0D : this.x);
|
||||
}
|
||||
|
||||
- Function function;
|
||||
+ Function<Vec3D, Vec3D> function; // CraftBukkit - decompile error
|
||||
|
||||
if (this.s == null && this.t == null && this.u == null) {
|
||||
function = (vec3d) -> {
|
||||
@@ -188,8 +188,10 @@
|
||||
};
|
||||
}
|
||||
|
||||
- protected void parseSelector() throws CommandSyntaxException {
|
||||
- this.checkPermissions = true;
|
||||
+ // CraftBukkit start
|
||||
+ protected void parseSelector(boolean overridePermissions) throws CommandSyntaxException {
|
||||
+ this.checkPermissions = !overridePermissions;
|
||||
+ // CraftBukkit end
|
||||
this.G = this::d;
|
||||
if (!this.l.canRead()) {
|
||||
throw ArgumentParserSelector.d.createWithContext(this.l);
|
||||
@@ -443,6 +445,12 @@
|
||||
}
|
||||
|
||||
public EntitySelector parse() throws CommandSyntaxException {
|
||||
+ // CraftBukkit start
|
||||
+ return parse(false);
|
||||
+ }
|
||||
+
|
||||
+ public EntitySelector parse(boolean overridePermissions) throws CommandSyntaxException {
|
||||
+ // CraftBukkit end
|
||||
this.E = this.l.getCursor();
|
||||
this.G = this::b;
|
||||
if (this.l.canRead() && this.l.peek() == '@') {
|
||||
@@ -451,7 +459,7 @@
|
||||
}
|
||||
|
||||
this.l.skip();
|
||||
- this.parseSelector();
|
||||
+ this.parseSelector(overridePermissions); // CraftBukkit
|
||||
} else {
|
||||
this.c();
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
--- a/net/minecraft/server/EntitySelector.java
|
||||
+++ b/net/minecraft/server/EntitySelector.java
|
||||
@@ -64,7 +64,7 @@
|
||||
}
|
||||
|
||||
private void e(CommandListenerWrapper commandlistenerwrapper) throws CommandSyntaxException {
|
||||
- if (this.checkPermissions && !commandlistenerwrapper.hasPermission(2)) {
|
||||
+ if (this.checkPermissions && !commandlistenerwrapper.hasPermission(2, "minecraft.command.selector")) { // CraftBukkit
|
||||
throw ArgumentEntity.f.create();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user