Update to Minecraft 1.17

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot
2021-06-11 15:00:00 +10:00
parent 75faba7fde
commit b3a8254758
619 changed files with 10708 additions and 8451 deletions

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/commands/arguments/ArgumentEntity.java
+++ b/net/minecraft/commands/arguments/ArgumentEntity.java
@@ -93,9 +93,15 @@
@@ -95,9 +95,15 @@
}
public EntitySelector parse(StringReader stringreader) throws CommandSyntaxException {
@@ -15,5 +15,5 @@
- EntitySelector entityselector = argumentparserselector.parse();
+ EntitySelector entityselector = argumentparserselector.parse(overridePermissions); // CraftBukkit
if (entityselector.a() > 1 && this.h) {
if (this.i) {
if (entityselector.a() > 1 && this.single) {
if (this.playersOnly) {

View File

@@ -1,15 +1,15 @@
--- a/net/minecraft/commands/arguments/blocks/ArgumentBlock.java
+++ b/net/minecraft/commands/arguments/blocks/ArgumentBlock.java
@@ -55,7 +55,7 @@
@@ -61,7 +61,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;
@@ -231,7 +231,7 @@
private final StringReader reader;
private final boolean forTesting;
- private final Map<IBlockState<?>, Comparable<?>> properties = Maps.newHashMap();
+ private final Map<IBlockState<?>, Comparable<?>> properties = Maps.newLinkedHashMap(); // CraftBukkit - stable
private final Map<String, String> vagueProperties = Maps.newHashMap();
private MinecraftKey id = new MinecraftKey("");
private BlockStateList<Block, IBlockData> definition;
@@ -237,7 +237,7 @@
Iterator iterator = iblockstate.getValues().iterator();
while (iterator.hasNext()) {
@@ -18,16 +18,16 @@
if (t0 instanceof Integer) {
suggestionsbuilder.suggest((Integer) t0);
@@ -500,7 +500,7 @@
@@ -506,7 +506,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());
- this.state = (IBlockData) this.state.set(iblockstate, (Comparable) optional.get());
+ this.state = (IBlockData) this.state.set(iblockstate, (T) optional.get()); // CraftBukkit - decompile error
this.properties.put(iblockstate, (Comparable) optional.get());
} else {
this.i.setCursor(i);
@@ -534,7 +534,7 @@
this.reader.setCursor(i);
@@ -540,7 +540,7 @@
private static <T extends Comparable<T>> void a(StringBuilder stringbuilder, IBlockState<T> iblockstate, Comparable<?> comparable) {
stringbuilder.append(iblockstate.getName());
stringbuilder.append('=');

View File

@@ -1,28 +1,28 @@
--- a/net/minecraft/commands/arguments/selector/ArgumentParserSelector.java
+++ b/net/minecraft/commands/arguments/selector/ArgumentParserSelector.java
@@ -137,7 +137,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);
@@ -149,7 +149,7 @@
axisalignedbb = this.a(this.deltaX == null ? 0.0D : this.deltaX, this.deltaY == null ? 0.0D : this.deltaY, this.deltaZ == null ? 0.0D : this.deltaZ);
}
- Function function;
+ Function<Vec3D, Vec3D> function; // CraftBukkit - decompile error
if (this.s == null && this.t == null && this.u == null) {
if (this.x == null && this.y == null && this.z == null) {
function = (vec3d) -> {
@@ -198,8 +198,10 @@
@@ -206,8 +206,10 @@
};
}
- protected void parseSelector() throws CommandSyntaxException {
- this.checkPermissions = true;
- this.usesSelectors = true;
+ // CraftBukkit start
+ protected void parseSelector(boolean overridePermissions) throws CommandSyntaxException {
+ this.checkPermissions = !overridePermissions;
+ this.usesSelectors = !overridePermissions;
+ // CraftBukkit end
this.G = this::d;
if (!this.l.canRead()) {
throw ArgumentParserSelector.d.createWithContext(this.l);
@@ -453,6 +455,12 @@
this.suggestions = this::d;
if (!this.reader.canRead()) {
throw ArgumentParserSelector.ERROR_MISSING_SELECTOR_TYPE.createWithContext(this.reader);
@@ -465,6 +467,12 @@
}
public EntitySelector parse() throws CommandSyntaxException {
@@ -32,13 +32,13 @@
+
+ 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() == '@') {
@@ -461,7 +469,7 @@
this.startPosition = this.reader.getCursor();
this.suggestions = this::b;
if (this.reader.canRead() && this.reader.peek() == '@') {
@@ -473,7 +481,7 @@
}
this.l.skip();
this.reader.skip();
- this.parseSelector();
+ this.parseSelector(overridePermissions); // CraftBukkit
} else {

View File

@@ -1,11 +1,11 @@
--- a/net/minecraft/commands/arguments/selector/EntitySelector.java
+++ b/net/minecraft/commands/arguments/selector/EntitySelector.java
@@ -75,7 +75,7 @@
@@ -90,7 +90,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();
- if (this.usesSelector && !commandlistenerwrapper.hasPermission(2)) {
+ if (this.usesSelector && !commandlistenerwrapper.hasPermission(2, "minecraft.command.selector")) { // CraftBukkit
throw ArgumentEntity.ERROR_SELECTORS_NOT_ALLOWED.create();
}
}