BlockPos.withinManhattan decomp fix

This commit is contained in:
Jason Penilla 2021-06-15 06:55:25 -07:00
parent df2247b2ed
commit e3fea251a6
No known key found for this signature in database
GPG key ID: 0E75A301420E48F8
4 changed files with 50 additions and 13 deletions

View file

@ -4,6 +4,43 @@ Date: Fri, 11 Jun 2021 05:25:03 -0500
Subject: [PATCH] Decompile fixes
diff --git a/src/main/java/net/minecraft/core/BlockPos.java b/src/main/java/net/minecraft/core/BlockPos.java
index 1bd6ef643b17b059eb525035496b816a098279c4..891fc7f4cbea8eccd580f371715478265339c0cc 100644
--- a/src/main/java/net/minecraft/core/BlockPos.java
+++ b/src/main/java/net/minecraft/core/BlockPos.java
@@ -270,9 +270,11 @@ public class BlockPos extends Vec3i {
public static Iterable<BlockPos> withinManhattan(BlockPos center, int rangeX, int rangeY, int rangeZ) {
int i = rangeX + rangeY + rangeZ;
- int j = center.getX();
- int k = center.getY();
- int l = center.getZ();
+ // Paper start - rename variables to fix conflict with anonymous class (decompile fix)
+ int centerX = center.getX();
+ int centerY = center.getY();
+ int centerZ = center.getZ();
+ // Paper end
return () -> {
return new AbstractIterator<BlockPos>() {
private final BlockPos.MutableBlockPos cursor = new BlockPos.MutableBlockPos();
@@ -287,7 +289,7 @@ public class BlockPos extends Vec3i {
protected BlockPos computeNext() {
if (this.zMirror) {
this.zMirror = false;
- this.cursor.setZ(l - (this.cursor.getZ() - l));
+ this.cursor.setZ(centerZ - (this.cursor.getZ() - centerZ)); // Paper - decompile fix
return this.cursor;
} else {
BlockPos blockPos;
@@ -313,7 +315,7 @@ public class BlockPos extends Vec3i {
int k = this.currentDepth - Math.abs(i) - Math.abs(j);
if (k <= rangeZ) {
this.zMirror = k != 0;
- blockPos = this.cursor.set(j + i, k + j, l + k);
+ blockPos = this.cursor.set(centerX + i, centerY + j, centerZ + k); // Paper - decompile fix
}
}
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 0000a0057ec4ee2db72e4ea1bf421f95d9d9fdc6..729e55535d833f8f6ff65bf226aac5ecdec44990 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
@ -63,7 +100,7 @@ index c88dc823ca0c2f83bc10886208d498ea77523d68..dcfd0b107ac7bd1633f3b681cd5f5e26
while (iterator.hasNext()) {
diff --git a/src/main/java/net/minecraft/world/item/crafting/RecipeManager.java b/src/main/java/net/minecraft/world/item/crafting/RecipeManager.java
index b4a5709b03e400d00504f33a9b34019d2b7bf115..2d79d4014770081fcd58a929e5fe0a26ac1b8023 100644
index efb37470d4927def456c382420775a815594aa58..9bc0ccf6acccd5505bac7b8a6bfb7597a43570cf 100644
--- a/src/main/java/net/minecraft/world/item/crafting/RecipeManager.java
+++ b/src/main/java/net/minecraft/world/item/crafting/RecipeManager.java
@@ -172,7 +172,7 @@ public class RecipeManager extends SimpleJsonResourceReloadListener {

View file

@ -18,10 +18,10 @@ index 8fd67e0be207561d329b417959f6c537cc8b7c49..23c0914685e51de9dcdbb305c203efd4
public static <V> CompletableFuture<List<V>> sequence(List<? extends CompletableFuture<? extends V>> futures) {
diff --git a/src/main/java/net/minecraft/core/BlockPos.java b/src/main/java/net/minecraft/core/BlockPos.java
index 1bd6ef643b17b059eb525035496b816a098279c4..3cf71f85da94bcda5d4527b5f3e18d959c6c4634 100644
index 891fc7f4cbea8eccd580f371715478265339c0cc..a153ca538d237fab567550b0bfcdf5b2985c56f8 100644
--- a/src/main/java/net/minecraft/core/BlockPos.java
+++ b/src/main/java/net/minecraft/core/BlockPos.java
@@ -367,12 +367,12 @@ public class BlockPos extends Vec3i {
@@ -369,12 +369,12 @@ public class BlockPos extends Vec3i {
if (this.index == l) {
return this.endOfData();
} else {
@ -222,7 +222,7 @@ index d4488ebc4d4f50e1c3ccfeeb8bb82d06a7a90c30..37110c535b9fe25b53b5ebe9aa448ade
});
} finally {
diff --git a/src/main/java/net/minecraft/world/item/crafting/RecipeManager.java b/src/main/java/net/minecraft/world/item/crafting/RecipeManager.java
index 2d79d4014770081fcd58a929e5fe0a26ac1b8023..f39a82bb231f5623fc69b044e6c17e742f56171a 100644
index 9bc0ccf6acccd5505bac7b8a6bfb7597a43570cf..396cf81c2a501a09ab742f53d524463741c4d1ed 100644
--- a/src/main/java/net/minecraft/world/item/crafting/RecipeManager.java
+++ b/src/main/java/net/minecraft/world/item/crafting/RecipeManager.java
@@ -75,7 +75,7 @@ public class RecipeManager extends SimpleJsonResourceReloadListener {

View file

@ -2271,7 +2271,7 @@ index 23c0914685e51de9dcdbb305c203efd4f2a73128..6f29d1fc437764a75d592ccb0c0ddc05
public static long getEpochMillis() {
diff --git a/src/main/java/net/minecraft/core/BlockPos.java b/src/main/java/net/minecraft/core/BlockPos.java
index 3cf71f85da94bcda5d4527b5f3e18d959c6c4634..c2309751e3798874eee6b469129121c2e317fbc3 100644
index a153ca538d237fab567550b0bfcdf5b2985c56f8..022cccbc52a7dda2f6bf0999905db82dd650b5ef 100644
--- a/src/main/java/net/minecraft/core/BlockPos.java
+++ b/src/main/java/net/minecraft/core/BlockPos.java
@@ -104,6 +104,7 @@ public class BlockPos extends Vec3i {
@ -2282,7 +2282,7 @@ index 3cf71f85da94bcda5d4527b5f3e18d959c6c4634..c2309751e3798874eee6b469129121c2
@Override
public BlockPos offset(int i, int j, int k) {
return i == 0 && j == 0 && k == 0 ? this : new BlockPos(this.getX() + i, this.getY() + j, this.getZ() + k);
@@ -459,6 +460,7 @@ public class BlockPos extends Vec3i {
@@ -461,6 +462,7 @@ public class BlockPos extends Vec3i {
return super.rotate(rotation).immutable();
}
@ -2290,7 +2290,7 @@ index 3cf71f85da94bcda5d4527b5f3e18d959c6c4634..c2309751e3798874eee6b469129121c2
public BlockPos.MutableBlockPos set(int x, int y, int z) {
this.setX(x);
this.setY(y);
@@ -466,6 +468,7 @@ public class BlockPos extends Vec3i {
@@ -468,6 +470,7 @@ public class BlockPos extends Vec3i {
return this;
}
@ -2298,7 +2298,7 @@ index 3cf71f85da94bcda5d4527b5f3e18d959c6c4634..c2309751e3798874eee6b469129121c2
public BlockPos.MutableBlockPos set(double x, double y, double z) {
return this.set(Mth.floor(x), Mth.floor(y), Mth.floor(z));
}
@@ -523,6 +526,7 @@ public class BlockPos extends Vec3i {
@@ -525,6 +528,7 @@ public class BlockPos extends Vec3i {
}
}
@ -2306,7 +2306,7 @@ index 3cf71f85da94bcda5d4527b5f3e18d959c6c4634..c2309751e3798874eee6b469129121c2
@Override
public BlockPos.MutableBlockPos setX(int i) {
super.setX(i);
@@ -540,6 +544,7 @@ public class BlockPos extends Vec3i {
@@ -542,6 +546,7 @@ public class BlockPos extends Vec3i {
super.setZ(i);
return this;
}
@ -3425,7 +3425,7 @@ index ea44904fdf709ae097f5ede128193a78c1f49d35..b6eb04733611b63916453f36abf2ae61
public final PrimaryLevelData serverLevelData; // CraftBukkit - type
final EntityTickList entityTickList;
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
index 7d55cece82e51ebadee07add83324351ed35ac49..59e58647e0650997b523a683aa52cb922a1d9c51 100644
index d25086e37b7ea34fd586be7818c6b585760ce18e..99292d239dfdd2c0aaeece2b526db011b17aa121 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -228,6 +228,8 @@ public class ServerPlayer extends Player {
@ -3490,7 +3490,7 @@ index 391bae98e542333a431fb48bf0675c0e8a1873ac..0f6b534a4c789a2f09f6c4624e5d58b9
public BlockState getBlockState(BlockPos pos) {
return this.getChunk(SectionPos.blockToSectionCoord(pos.getX()), SectionPos.blockToSectionCoord(pos.getZ())).getBlockState(pos);
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 65093c26247ff8fc6e487cd5a6b88cd246a79841..73f6e956afd2a679ffda2e7e21485e0b1791ecdf 100644
index e06254a78334b009bf03635927361a369f8ee51a..83e71d07f86c115a0df1eb56ae9f2b127821fe80 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -219,9 +219,9 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser

View file

@ -5,10 +5,10 @@ Subject: [PATCH] call PortalCreateEvent players and end platform
diff --git a/src/main/java/net/minecraft/core/BlockPos.java b/src/main/java/net/minecraft/core/BlockPos.java
index fd5c22a3d281d8d913c353c8a668ec51b885066a..8c3b34b3d55af4aa8e3619a5bdf0eadb7baad029 100644
index 8f0cf4297015f3cbe709e2eb82280cac72489925..22ea0da3836b61bb018ae974d2b8c7546b9528d6 100644
--- a/src/main/java/net/minecraft/core/BlockPos.java
+++ b/src/main/java/net/minecraft/core/BlockPos.java
@@ -521,6 +521,7 @@ public class BlockPos extends Vec3i {
@@ -523,6 +523,7 @@ public class BlockPos extends Vec3i {
return this.set(this.getX() + direction.getStepX() * distance, this.getY() + direction.getStepY() * distance, this.getZ() + direction.getStepZ() * distance);
}