diff --git a/src/main/java/org/embeddedt/modernfix/common/mixin/perf/attribute_supplier_dedup/AttributeSupplierMixin.java b/src/main/java/org/embeddedt/modernfix/common/mixin/perf/attribute_supplier_dedup/AttributeSupplierMixin.java index 5ffc3489..d4d0901b 100644 --- a/src/main/java/org/embeddedt/modernfix/common/mixin/perf/attribute_supplier_dedup/AttributeSupplierMixin.java +++ b/src/main/java/org/embeddedt/modernfix/common/mixin/perf/attribute_supplier_dedup/AttributeSupplierMixin.java @@ -1,5 +1,6 @@ package org.embeddedt.modernfix.common.mixin.perf.attribute_supplier_dedup; +import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap; import net.minecraft.world.entity.ai.attributes.Attribute; import net.minecraft.world.entity.ai.attributes.AttributeInstance; import net.minecraft.world.entity.ai.attributes.AttributeSupplier; @@ -22,11 +23,11 @@ public class AttributeSupplierMixin { /** * @author embeddedt - * @reason Java 9's Map.of() implementation is significantly more compact than ImmutableMap, and we do not + * @reason more compact than ImmutableMap due to less wrapper objects, and we do not * care about insertion order in this context */ @Inject(method = "", at = @At("RETURN")) private void useCompactJavaMap(Map instances, CallbackInfo ci) { - this.instances = Map.copyOf(this.instances); + this.instances = new Object2ObjectOpenHashMap<>(this.instances); } } \ No newline at end of file