Switch to using ForgeFlower for Paper Only mc-dev imports

ForgeFlower is better than Spigots FernFlower at decompiling the source.

However, in order to maintain the CraftBukkit patches, we must keep
using spigots for the primary.

However, for any file that we import on top of Spigots imported files
there is nothing stopping us from using better decompiled files.

So these changes will use ForgeFlower to maintain a better set of
decomped files, so anything we add on top of Paper can start off
in a better spot.
This commit is contained in:
Aikar
2018-08-31 18:56:57 -04:00
parent bd4da1aea0
commit e82ef9ec05
74 changed files with 987 additions and 1045 deletions

View File

@@ -21,12 +21,12 @@ 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 680764b342..25334377a2 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;
@Immutable
public class BaseBlockPosition implements Comparable<BaseBlockPosition> {
public static final BaseBlockPosition ZERO = new BaseBlockPosition(0, 0, 0);
- private final int a;
- private final int b;
@@ -56,7 +56,7 @@ index 58f8b4b720..98992513da 100644
public BaseBlockPosition(double d0, double d1, double d2) {
@@ -0,0 +0,0 @@ public class BaseBlockPosition implements Comparable<BaseBlockPosition> {
return this.getY() == baseblockposition.getY() ? (this.getZ() == baseblockposition.getZ() ? this.getX() - baseblockposition.getX() : this.getZ() - baseblockposition.getZ()) : this.getY() - baseblockposition.getY();
}
}
- public int getX() {
@@ -77,47 +77,47 @@ index 58f8b4b720..98992513da 100644
}
+ // Paper end
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());
public BaseBlockPosition d(BaseBlockPosition baseblockposition1) {
return new BaseBlockPosition(this.getY() * baseblockposition1.getZ() - this.getZ() * baseblockposition1.getY(), this.getZ() * baseblockposition1.getX() - this.getX() * baseblockposition1.getZ(), this.getX() * baseblockposition1.getY() - this.getY() * baseblockposition1.getX());
diff --git a/src/main/java/net/minecraft/server/BlockPosition.java b/src/main/java/net/minecraft/server/BlockPosition.java
index 42e5e9ad8f..936a49a3e8 100644
index 1dfd71df0a..986b1e13a5 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 {
if (this.g == null) {
this.g = new BlockPosition.MutableBlockPosition(i, j, k);
this.g = new BlockPosition.MutableBlockPosition(ix, jx, kx);
return this.g;
- } else if (this.g.b == l && this.g.c == i1 && this.g.d == j1) {
+ } else if (this.g.x == l && this.g.y == i1 && this.g.z == j1) { // Paper
return (BlockPosition.MutableBlockPosition) this.endOfData();
+ } else if (this.g.x == l && this.g.y == i1 && this.g.z == j1) { // Paper - use x/y/z
return (BlockPosition.MutableBlockPosition)this.endOfData();
} else {
- 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.b = ix; // Paper - decompile fix 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.b = ix; // Paper - decompile fix Readd line removed by the decompiler
- this.g.c = jx; // Paper - decompile fix 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.x = ix; // Paper - decompile fix 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.x = ix; // Paper - decompile fix Readd line removed by the decompiler
+ this.g.y = jx; // Paper - decompile fix Readd line removed by the decompiler
+ ++this.g.z;
+ // Paper end
}
return this.g;
@@ -0,0 +0,0 @@ public class BlockPosition extends BaseBlockPosition {
}
public static class MutableBlockPosition extends BlockPosition {
+ // Paper start - comment out
+ /*
protected int b;
@@ -200,5 +200,5 @@ index 42e5e9ad8f..936a49a3e8 100644
+ this.y = i; // Paper change to y
}
public BlockPosition h() {
public BlockPosition toBlockPosition() { return h(); } // Paper - OBFHELPER
--