mirror of
https://github.com/FabricMC/fabric.git
synced 2025-07-28 15:09:35 -04:00
Use ConcurrentHashMap
inside RegistryAttributeImpl
(#3970)
This commit is contained in:
parent
f9000df732
commit
a5d6675361
1 changed files with 2 additions and 2 deletions
|
@ -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());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue