Fix broken block iteration (#1269)

Fixes https://github.com/PaperMC/Paper/issues/1259 and generation of the end pillars
This commit is contained in:
Brokkonaut 2018-07-25 03:39:30 +02:00
parent 9b2a8bb9cf
commit 875c84df6f
4 changed files with 27 additions and 11 deletions

View file

@ -5,7 +5,7 @@ Subject: [PATCH] MC Dev fixes
diff --git a/src/main/java/com/destroystokyo/paper/PaperCommand.java b/src/main/java/com/destroystokyo/paper/PaperCommand.java diff --git a/src/main/java/com/destroystokyo/paper/PaperCommand.java b/src/main/java/com/destroystokyo/paper/PaperCommand.java
index e8f7b729..a0ebc1ea 100644 index e8f7b7292..a0ebc1eaa 100644
--- a/src/main/java/com/destroystokyo/paper/PaperCommand.java --- a/src/main/java/com/destroystokyo/paper/PaperCommand.java
+++ b/src/main/java/com/destroystokyo/paper/PaperCommand.java +++ b/src/main/java/com/destroystokyo/paper/PaperCommand.java
@@ -0,0 +0,0 @@ public class PaperCommand extends Command { @@ -0,0 +0,0 @@ public class PaperCommand extends Command {
@ -15,7 +15,7 @@ index e8f7b729..a0ebc1ea 100644
+ +
} }
diff --git a/src/main/java/net/minecraft/server/BlockPosition.java b/src/main/java/net/minecraft/server/BlockPosition.java diff --git a/src/main/java/net/minecraft/server/BlockPosition.java b/src/main/java/net/minecraft/server/BlockPosition.java
index 002da2a1..121a137f 100644 index 002da2a19..9f3aa2459 100644
--- a/src/main/java/net/minecraft/server/BlockPosition.java --- a/src/main/java/net/minecraft/server/BlockPosition.java
+++ b/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 { @@ -0,0 +0,0 @@ public class BlockPosition extends BaseBlockPosition {
@ -56,8 +56,20 @@ index 002da2a1..121a137f 100644
++this.j; ++this.j;
} }
@@ -0,0 +0,0 @@ public class BlockPosition extends BaseBlockPosition {
if (this.g.b < l) {
++this.g.b;
} else if (this.g.c < i1) {
+ this.g.b = i; // Paper - Readd line removed by the decompiler
++this.g.c;
} else if (this.g.d < j1) {
+ this.g.b = i; // Paper - Readd line removed by the decompiler
+ this.g.c = j; // Paper - Readd line removed by the decompiler
++this.g.d;
}
diff --git a/src/main/java/net/minecraft/server/DefinedStructure.java b/src/main/java/net/minecraft/server/DefinedStructure.java diff --git a/src/main/java/net/minecraft/server/DefinedStructure.java b/src/main/java/net/minecraft/server/DefinedStructure.java
index a661789c..785a1a21 100644 index a661789c1..785a1a218 100644
--- a/src/main/java/net/minecraft/server/DefinedStructure.java --- a/src/main/java/net/minecraft/server/DefinedStructure.java
+++ b/src/main/java/net/minecraft/server/DefinedStructure.java +++ b/src/main/java/net/minecraft/server/DefinedStructure.java
@@ -0,0 +0,0 @@ public class DefinedStructure { @@ -0,0 +0,0 @@ public class DefinedStructure {
@ -112,7 +124,7 @@ index a661789c..785a1a21 100644
public Iterator<IBlockData> iterator() { public Iterator<IBlockData> iterator() {
diff --git a/src/main/java/net/minecraft/server/RegistryID.java b/src/main/java/net/minecraft/server/RegistryID.java diff --git a/src/main/java/net/minecraft/server/RegistryID.java b/src/main/java/net/minecraft/server/RegistryID.java
index 3b8f6ec1..bde5714d 100644 index 3b8f6ec16..bde5714dd 100644
--- a/src/main/java/net/minecraft/server/RegistryID.java --- a/src/main/java/net/minecraft/server/RegistryID.java
+++ b/src/main/java/net/minecraft/server/RegistryID.java +++ b/src/main/java/net/minecraft/server/RegistryID.java
@@ -0,0 +0,0 @@ import java.util.Arrays; @@ -0,0 +0,0 @@ import java.util.Arrays;
@ -152,6 +164,4 @@ index 3b8f6ec1..bde5714d 100644
this.e = 0; this.e = 0;
this.f = 0; this.f = 0;
-- --
2.17.0 (Apple Git-106)

View file

@ -18,7 +18,7 @@ index c3e990bdf..e2a7b4be2 100644
} }
} }
diff --git a/src/main/java/net/minecraft/server/BlockPosition.java b/src/main/java/net/minecraft/server/BlockPosition.java diff --git a/src/main/java/net/minecraft/server/BlockPosition.java b/src/main/java/net/minecraft/server/BlockPosition.java
index 121a137f3..279045e49 100644 index 9f3aa2459..7dbea9090 100644
--- a/src/main/java/net/minecraft/server/BlockPosition.java --- a/src/main/java/net/minecraft/server/BlockPosition.java
+++ b/src/main/java/net/minecraft/server/BlockPosition.java +++ b/src/main/java/net/minecraft/server/BlockPosition.java
@@ -0,0 +0,0 @@ import org.apache.logging.log4j.Logger; @@ -0,0 +0,0 @@ import org.apache.logging.log4j.Logger;

View file

@ -31,7 +31,7 @@ index e2a7b4be2..58f8b4b72 100644
public BaseBlockPosition(int i, int j, int k) { public BaseBlockPosition(int i, int j, int k) {
this.a = i; this.a = i;
diff --git a/src/main/java/net/minecraft/server/BlockPosition.java b/src/main/java/net/minecraft/server/BlockPosition.java diff --git a/src/main/java/net/minecraft/server/BlockPosition.java b/src/main/java/net/minecraft/server/BlockPosition.java
index 279045e49..7122a9aa8 100644 index 7dbea9090..252e00e16 100644
--- a/src/main/java/net/minecraft/server/BlockPosition.java --- a/src/main/java/net/minecraft/server/BlockPosition.java
+++ b/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 { @@ -0,0 +0,0 @@ public class BlockPosition extends BaseBlockPosition {

View file

@ -21,7 +21,7 @@ This is based upon conclusions drawn from inspecting the assenmbly generated byt
They had 'callq' (invoke) instead of 'mov' (get from memory) instructions. They had 'callq' (invoke) instead of 'mov' (get from memory) instructions.
diff --git a/src/main/java/net/minecraft/server/BaseBlockPosition.java b/src/main/java/net/minecraft/server/BaseBlockPosition.java diff --git a/src/main/java/net/minecraft/server/BaseBlockPosition.java b/src/main/java/net/minecraft/server/BaseBlockPosition.java
index 58f8b4b720..98992513da 100644 index 58f8b4b72..98992513d 100644
--- a/src/main/java/net/minecraft/server/BaseBlockPosition.java --- a/src/main/java/net/minecraft/server/BaseBlockPosition.java
+++ b/src/main/java/net/minecraft/server/BaseBlockPosition.java +++ b/src/main/java/net/minecraft/server/BaseBlockPosition.java
@@ -0,0 +0,0 @@ import javax.annotation.concurrent.Immutable; @@ -0,0 +0,0 @@ import javax.annotation.concurrent.Immutable;
@ -80,7 +80,7 @@ index 58f8b4b720..98992513da 100644
public BaseBlockPosition d(BaseBlockPosition baseblockposition) { public BaseBlockPosition d(BaseBlockPosition baseblockposition) {
return new BaseBlockPosition(this.getY() * baseblockposition.getZ() - this.getZ() * baseblockposition.getY(), this.getZ() * baseblockposition.getX() - this.getX() * baseblockposition.getZ(), this.getX() * baseblockposition.getY() - this.getY() * baseblockposition.getX()); return new BaseBlockPosition(this.getY() * baseblockposition.getZ() - this.getZ() * baseblockposition.getY(), this.getZ() * baseblockposition.getX() - this.getX() * baseblockposition.getZ(), this.getX() * baseblockposition.getY() - this.getY() * baseblockposition.getX());
diff --git a/src/main/java/net/minecraft/server/BlockPosition.java b/src/main/java/net/minecraft/server/BlockPosition.java diff --git a/src/main/java/net/minecraft/server/BlockPosition.java b/src/main/java/net/minecraft/server/BlockPosition.java
index 7122a9aa8a..2f6fc330b3 100644 index 252e00e16..f769b178c 100644
--- a/src/main/java/net/minecraft/server/BlockPosition.java --- a/src/main/java/net/minecraft/server/BlockPosition.java
+++ b/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 { @@ -0,0 +0,0 @@ public class BlockPosition extends BaseBlockPosition {
@ -94,15 +94,21 @@ index 7122a9aa8a..2f6fc330b3 100644
- if (this.g.b < l) { - if (this.g.b < l) {
- ++this.g.b; - ++this.g.b;
- } else if (this.g.c < i1) { - } else if (this.g.c < i1) {
- this.g.b = i; // Paper - Readd line removed by the decompiler
- ++this.g.c; - ++this.g.c;
- } else if (this.g.d < j1) { - } else if (this.g.d < j1) {
- this.g.b = i; // Paper - Readd line removed by the decompiler
- this.g.c = j; // Paper - Readd line removed by the decompiler
- ++this.g.d; - ++this.g.d;
+ // Paper start - use xyz + // Paper start - use xyz
+ if (this.g.x < l) { + if (this.g.x < l) {
+ ++this.g.x; + ++this.g.x;
+ } else if (this.g.y < i1) { + } else if (this.g.y < i1) {
+ this.g.x = i; // Paper - Readd line removed by the decompiler
+ ++this.g.y; + ++this.g.y;
+ } else if (this.g.z < j1) { + } else if (this.g.z < j1) {
+ this.g.x = i; // Paper - Readd line removed by the decompiler
+ this.g.y = j; // Paper - Readd line removed by the decompiler
+ ++this.g.z; + ++this.g.z;
+ // Paper end + // Paper end
} }