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

@@ -6,31 +6,31 @@ Subject: [PATCH] Optimize RegistryID.c()
This is a frequent hotspot for world loading/saving.
diff --git a/src/main/java/net/minecraft/server/RegistryID.java b/src/main/java/net/minecraft/server/RegistryID.java
index bde5714dd6..a01cda9d81 100644
index d03ac0e70c..9242999f70 100644
--- a/src/main/java/net/minecraft/server/RegistryID.java
+++ b/src/main/java/net/minecraft/server/RegistryID.java
@@ -0,0 +0,0 @@ public class RegistryID<K> implements Registry { // Paper - decompile fix
@@ -0,0 +0,0 @@ public class RegistryID<K> implements Registry<K> {
private K[] d;
private int e;
private int f;
+ private java.util.BitSet usedIds; // Paper
public RegistryID(int i) {
i = (int) ((float) i / 0.8F);
this.b = (K[]) (new Object[i]); // Paper - decompile fix
i = (int)((float)i / 0.8F);
this.b = (K[])(new Object[i]);
this.c = new int[i];
this.d = (K[]) (new Object[i]); // Paper - decompile fix
this.d = (K[])(new Object[i]);
+ this.usedIds = new java.util.BitSet(); // Paper
}
public int getId(@Nullable K k0) {
@@ -0,0 +0,0 @@ public class RegistryID<K> implements Registry { // Paper - decompile fix
public int getId(@Nullable K object) {
@@ -0,0 +0,0 @@ public class RegistryID<K> implements Registry<K> {
}
private int c() {
+ // Paper start
+ /*
while (this.e < this.d.length && this.d[this.e] != null) {
while(this.e < this.d.length && this.d[this.e] != null) {
++this.e;
}
+ */
@@ -39,24 +39,24 @@ index bde5714dd6..a01cda9d81 100644
return this.e;
}
@@ -0,0 +0,0 @@ public class RegistryID<K> implements Registry { // Paper - decompile fix
this.d = (K[]) (new Object[i]); // Paper - decompile fix
@@ -0,0 +0,0 @@ public class RegistryID<K> implements Registry<K> {
this.d = (K[])(new Object[i]);
this.e = 0;
this.f = 0;
+ this.usedIds.clear(); // Paper
for (int j = 0; j < aobject.length; ++j) {
for(int j = 0; j < aobject.length; ++j) {
if (aobject[j] != null) {
@@ -0,0 +0,0 @@ public class RegistryID<K> implements Registry { // Paper - decompile fix
this.b[k] = k0;
this.c[k] = i;
this.d[i] = k0;
@@ -0,0 +0,0 @@ public class RegistryID<K> implements Registry<K> {
this.b[l] = object;
this.c[l] = i;
this.d[i] = object;
+ this.usedIds.set(i); // Paper
++this.f;
if (i == this.e) {
++this.e;
@@ -0,0 +0,0 @@ public class RegistryID<K> implements Registry { // Paper - decompile fix
Arrays.fill(this.d, (Object) null);
@@ -0,0 +0,0 @@ public class RegistryID<K> implements Registry<K> {
Arrays.fill(this.d, (Object)null);
this.e = 0;
this.f = 0;
+ this.usedIds.clear(); // Paper