private final ObjectList<T> bf = new ObjectArrayList(256);
- private final Object2IntMap<T> bg = new Object2IntOpenCustomHashMap(SystemUtils.k());
+ private final Reference2IntOpenHashMap<T> bg = new Reference2IntOpenHashMap<T>(2048);// Paper - use bigger expected size to reduce collisions and direct intent for FastUtil to be identity map
private final BiMap<MinecraftKey, T> bh;
private final BiMap<ResourceKey<T>, T> bi;
private final Map<T, Lifecycle> bj;
@@ -0,0 +0,0 @@ public class RegistryMaterials<T> extends IRegistryWritable<T> {
public RegistryMaterials(ResourceKey<? extends IRegistry<T>> resourcekey, Lifecycle lifecycle) {
super(resourcekey, lifecycle);
this.bg.defaultReturnValue(-1);
- this.bh = HashBiMap.create();
- this.bi = HashBiMap.create();
- this.bj = Maps.newIdentityHashMap();
+ this.bh = HashBiMap.create(2048); // Paper - use bigger expected size to reduce collisions
+ this.bi = HashBiMap.create(2048); // Paper - use bigger expected size to reduce collisions
+ this.bj = new java.util.IdentityHashMap<>(2048); // Paper - use bigger expected size to reduce collisions