Use synchronized HashMap instead of CHM to permit null keys for buggy mods

Related: #157
This commit is contained in:
embeddedt 2023-07-10 09:01:18 -04:00
parent dfdbf8544a
commit 5315d80859
No known key found for this signature in database
GPG Key ID: A69433EC199B5613

View File

@ -13,8 +13,8 @@ import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import java.util.Collections;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
@Mixin(value = ItemProperties.class, priority = 700)
@ClientOnlyMixin
@ -24,7 +24,7 @@ public class ItemPropertiesMixin {
@Inject(method = "<clinit>", at = @At("RETURN"))
private static void useConcurrentMaps(CallbackInfo ci) {
GENERIC_PROPERTIES = new ConcurrentHashMap<>(GENERIC_PROPERTIES);
PROPERTIES = new ConcurrentHashMap<>(PROPERTIES);
GENERIC_PROPERTIES = Collections.synchronizedMap(GENERIC_PROPERTIES);
PROPERTIES = Collections.synchronizedMap(PROPERTIES);
}
}