diff --git a/Spigot-Server-Patches/Speedup-BlockPos-by-fixing-inlining.patch b/Spigot-Server-Patches/Speedup-BlockPos-by-fixing-inlining.patch index 4bcd9be3f8..f55d324b27 100644 --- a/Spigot-Server-Patches/Speedup-BlockPos-by-fixing-inlining.patch +++ b/Spigot-Server-Patches/Speedup-BlockPos-by-fixing-inlining.patch @@ -33,33 +33,52 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 - private final int c; - // Paper start - public boolean isValidLocation() { +- return a >= -30000000 && c >= -30000000 && a < 30000000 && c < 30000000 && b >= 0 && b < 256; + // Paper start - Make mutable and protected for MutableBlockPos and PooledBlockPos -+ protected int a; -+ protected int b; -+ protected int c; ++ protected int x; ++ protected int y; ++ protected int z; + + public final boolean isValidLocation() { - return a >= -30000000 && c >= -30000000 && a < 30000000 && c < 30000000 && b >= 0 && b < 256; ++ return x >= -30000000 && z >= -30000000 && x < 30000000 && z < 30000000 && y >= 0 && y < 256; } public boolean isInvalidYLocation() { +- return b < 0 || b >= 256; ++ return y < 0 || y >= 256; + } + // Paper end + + public BaseBlockPosition(int i, int j, int k) { +- this.a = i; +- this.b = j; +- this.c = k; ++ this.x = i; ++ this.y = j; ++ this.z = k; + } + + public BaseBlockPosition(double d0, double d1, double d2) { @@ -0,0 +0,0 @@ public class BaseBlockPosition implements Comparable { return this.getY() == baseblockposition.getY() ? (this.getZ() == baseblockposition.getZ() ? this.getX() - baseblockposition.getX() : this.getZ() - baseblockposition.getZ()) : this.getY() - baseblockposition.getY(); } - public int getX() { +- return this.a; + // Paper start - Only allow a single implementation + public final int getX() { - return this.a; ++ return this.x; } - public int getY() { +- return this.b; + public final int getY() { - return this.b; ++ return this.y; } - public int getZ() { +- return this.c; + public final int getZ() { - return this.c; ++ return this.z; } + // Paper end @@ -76,9 +95,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 - this.b.b = i; - this.b.c = j; - this.b.d = k; -+ ((BaseBlockPosition) this.b).a = i; -+ ((BaseBlockPosition) this.b).b = j; -+ ((BaseBlockPosition) this.b).c = k; ++ ((BaseBlockPosition) this.b).x = i; ++ ((BaseBlockPosition) this.b).y = j; ++ ((BaseBlockPosition) this.b).z = k; return this.b; } } @@ -107,9 +126,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 - this.c = j; - this.d = k; + // Paper start - Modify base position variables -+ ((BaseBlockPosition) this).a = i; -+ ((BaseBlockPosition) this).b = j; -+ ((BaseBlockPosition) this).c = k; ++ ((BaseBlockPosition) this).x = i; ++ ((BaseBlockPosition) this).y = j; ++ ((BaseBlockPosition) this).z = k; + // Paper end } @@ -136,9 +155,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 - this.c = j; - this.d = k; + // Paper start - Modify base position variables -+ ((BaseBlockPosition) this).a = i; -+ ((BaseBlockPosition) this).b = j; -+ ((BaseBlockPosition) this).c = k; ++ ((BaseBlockPosition) this).x = i; ++ ((BaseBlockPosition) this).y = j; ++ ((BaseBlockPosition) this).z = k; + // Paper end return this; } @@ -153,7 +172,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 public void p(int i) { - this.c = i; -+ ((BaseBlockPosition) this).b = i; // Paper - Modify base variable ++ ((BaseBlockPosition) this).y = i; // Paper - Modify base variable } public BlockPosition h() {