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

@@ -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.
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
+++ b/src/main/java/net/minecraft/server/BaseBlockPosition.java
@@ -0,0 +0,0 @@ import javax.annotation.concurrent.Immutable;
@@ -80,7 +80,7 @@ index 58f8b4b720..98992513da 100644
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());
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
+++ b/src/main/java/net/minecraft/server/BlockPosition.java
@@ -0,0 +0,0 @@ public class BlockPosition extends BaseBlockPosition {
@@ -94,15 +94,21 @@ index 7122a9aa8a..2f6fc330b3 100644
- 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;
+ // Paper start - use xyz
+ if (this.g.x < l) {
+ ++this.g.x;
+ } else if (this.g.y < i1) {
+ this.g.x = i; // Paper - Readd line removed by the decompiler
+ ++this.g.y;
+ } 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;
+ // Paper end
}