Little more progress
Keep getting interrupted so not as much as I'd like :(
This commit is contained in:
@@ -8,7 +8,7 @@ Use larger initial sizes to increase bucket capacity on the BiMap
|
||||
BiMap.get was seen to be using a good bit of CPU time.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/RegistryMaterials.java b/src/main/java/net/minecraft/server/RegistryMaterials.java
|
||||
index f291e05b26..fed38e6ef0 100644
|
||||
index 2d6a7b3a4..8477febca 100644
|
||||
--- a/src/main/java/net/minecraft/server/RegistryMaterials.java
|
||||
+++ b/src/main/java/net/minecraft/server/RegistryMaterials.java
|
||||
@@ -0,0 +0,0 @@ import org.apache.logging.log4j.Logger;
|
||||
@@ -17,20 +17,17 @@ index f291e05b26..fed38e6ef0 100644
|
||||
protected static final Logger LOGGER = LogManager.getLogger();
|
||||
- protected final RegistryID<T> b = new RegistryID<>(256);
|
||||
- protected final BiMap<MinecraftKey, T> c = HashBiMap.create();
|
||||
- protected Object[] d;
|
||||
+ protected final RegistryID<T> b = new RegistryID<>(2048); // Paper - use bigger expected size to reduce collisions
|
||||
+ protected final BiMap<MinecraftKey, T> c = HashBiMap.create(2048); // Paper - use bigger expected size to reduce collisions
|
||||
+ protected T[] d; // Paper - Decompile fix
|
||||
private int R;
|
||||
protected Object[] d;
|
||||
private int V;
|
||||
|
||||
public RegistryMaterials() {}
|
||||
@@ -0,0 +0,0 @@ public class RegistryMaterials<T> extends IRegistryWritable<T> {
|
||||
return null;
|
||||
}
|
||||
|
||||
- this.d = collection.toArray(new Object[collection.size()]);
|
||||
+ this.d = (T[]) collection.toArray(new Object[collection.size()]); // Paper - Decompile fix
|
||||
this.d = collection.toArray(new Object[collection.size()]);
|
||||
}
|
||||
|
||||
return this.d[random.nextInt(this.d.length)];
|
||||
- return this.d[random.nextInt(this.d.length)];
|
||||
+ return (T) this.d[random.nextInt(this.d.length)]; // Paper - Decompile fix
|
||||
}
|
||||
}
|
||||
--
|
||||
Reference in New Issue
Block a user