mirror of
https://github.com/FabricMC/fabric.git
synced 2025-09-04 16:59:11 +00:00
Use ConcurrentHashMap
inside RegistryAttributeImpl
(#3970)
(cherry picked from commit a5d6675361
)
This commit is contained in:
@@ -17,8 +17,8 @@
|
||||
package net.fabricmc.fabric.impl.registry.sync;
|
||||
|
||||
import java.util.EnumSet;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
import net.minecraft.registry.RegistryKey;
|
||||
|
||||
@@ -26,7 +26,7 @@ import net.fabricmc.fabric.api.event.registry.RegistryAttribute;
|
||||
import net.fabricmc.fabric.api.event.registry.RegistryAttributeHolder;
|
||||
|
||||
public final class RegistryAttributeImpl implements RegistryAttributeHolder {
|
||||
private static final Map<RegistryKey<?>, RegistryAttributeHolder> HOLDER_MAP = new HashMap<>();
|
||||
private static final Map<RegistryKey<?>, RegistryAttributeHolder> HOLDER_MAP = new ConcurrentHashMap<>();
|
||||
|
||||
public static RegistryAttributeHolder getHolder(RegistryKey<?> registryKey) {
|
||||
return HOLDER_MAP.computeIfAbsent(registryKey, key -> new RegistryAttributeImpl());
|
||||
|
Reference in New Issue
Block a user