mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-01 17:01:56 +01:00
Fix decompile/deobfuscation error in BlockPosition iterator
Some of the fields in the anonymous class are named the same as the surrounding method's parameters, which caused the fields to be initialized incorrectly. That way it keeps returning the same block position, resulting in an infinite loop during chunk generation.
This commit is contained in:
parent
c3a05c5ba0
commit
9a1643dab4
1 changed files with 42 additions and 0 deletions
|
@ -14,4 +14,46 @@ index e8f7b7292..a0ebc1eaa 100644
|
|||
}
|
||||
+
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/BlockPosition.java b/src/main/java/net/minecraft/server/BlockPosition.java
|
||||
index 002da2a19..121a137f3 100644
|
||||
--- a/src/main/java/net/minecraft/server/BlockPosition.java
|
||||
+++ b/src/main/java/net/minecraft/server/BlockPosition.java
|
||||
@@ -0,0 +0,0 @@ public class BlockPosition extends BaseBlockPosition {
|
||||
return a(Math.min(blockposition.getX(), blockposition1.getX()), Math.min(blockposition.getY(), blockposition1.getY()), Math.min(blockposition.getZ(), blockposition1.getZ()), Math.max(blockposition.getX(), blockposition1.getX()), Math.max(blockposition.getY(), blockposition1.getY()), Math.max(blockposition.getZ(), blockposition1.getZ()));
|
||||
}
|
||||
|
||||
- public static Iterable<BlockPosition> a(int i, int j, int k, int l, int i1, int j1) {
|
||||
+ public static Iterable<BlockPosition> a(int x0, int y0, int z0, int l, int i1, int j1) {
|
||||
return () -> {
|
||||
return new AbstractIterator() {
|
||||
private boolean g = true;
|
||||
@@ -0,0 +0,0 @@ public class BlockPosition extends BaseBlockPosition {
|
||||
protected BlockPosition a() {
|
||||
if (this.g) {
|
||||
this.g = false;
|
||||
- this.h = i;
|
||||
- this.i = j;
|
||||
- this.j = k;
|
||||
- return new BlockPosition(i, j, k);
|
||||
+ this.h = x0;
|
||||
+ this.i = y0;
|
||||
+ this.j = z0;
|
||||
+ return new BlockPosition(x0, y0, z0);
|
||||
} else if (this.h == l && this.i == i1 && this.j == j1) {
|
||||
return (BlockPosition) this.endOfData();
|
||||
} else {
|
||||
if (this.h < l) {
|
||||
++this.h;
|
||||
} else if (this.i < i1) {
|
||||
- this.h = i;
|
||||
+ this.h = x0;
|
||||
++this.i;
|
||||
} else if (this.j < j1) {
|
||||
- this.h = i;
|
||||
- this.i = j;
|
||||
+ this.h = x0;
|
||||
+ this.i = y0;
|
||||
++this.j;
|
||||
}
|
||||
|
||||
--
|
Loading…
Reference in a new issue