Package org.geysermc.geyser.registry
Class SimpleMappedRegistry<K,V>
java.lang.Object
org.geysermc.geyser.registry.Registry<M>
org.geysermc.geyser.registry.AbstractMappedRegistry<K,V,Map<K,V>>
org.geysermc.geyser.registry.SimpleMappedRegistry<K,V>
- Type Parameters:
K
- the keyV
- the value
A variant of
AbstractMappedRegistry
with Map
as the defined type. Unlike
MappedRegistry
, this registry does not support specifying your own Map class,
and only permits operations the Map
interface does, unless you manually cast.-
Field Summary
-
Constructor Summary
ModifierConstructorDescriptionprotected
SimpleMappedRegistry(I input, RegistryLoader<I,Map<K,V>> registryLoader)
-
Method Summary
Modifier and TypeMethodDescriptionstatic <I, K, V> SimpleMappedRegistry<K,V>
create(I input, Supplier<RegistryLoader<I,Map<K,V>>> registryLoader)
Creates a new mapped registry with the givenRegistryLoader
and input.static <I, K, V> SimpleMappedRegistry<K,V>
create(I input, RegistryLoader<I,Map<K,V>> registryLoader)
Creates a new mapped registry with the givenRegistryLoader
and input.static <I, K, V> SimpleMappedRegistry<K,V>
create(Supplier<RegistryLoader<I,Map<K,V>>> registryLoader)
Creates a new mapped registry with the givenRegistryLoader
supplier.static <I, K, V> SimpleMappedRegistry<K,V>
create(RegistryLoader<I,Map<K,V>> registryLoader)
Creates a new mapped registry with the givenRegistryLoader
.Methods inherited from class org.geysermc.geyser.registry.AbstractMappedRegistry
get, getOrDefault, map, register
-
Constructor Details
-
SimpleMappedRegistry
-
-
Method Details
-
create
public static <I, K, V> SimpleMappedRegistry<K,V> create(RegistryLoader<I,Map<K,V>> registryLoader)Creates a new mapped registry with the givenRegistryLoader
. The input type is not specified here, meaning the loader return type is either predefined, or the registry is populated at a later point.- Type Parameters:
I
- the inputK
- the map keyV
- the map value- Parameters:
registryLoader
- the registry loader- Returns:
- a new registry with the given RegistryLoader
-
create
public static <I, K, V> SimpleMappedRegistry<K,V> create(I input, RegistryLoader<I,Map<K,V>> registryLoader)Creates a new mapped registry with the givenRegistryLoader
and input.- Type Parameters:
I
- the inputK
- the map keyV
- the map value- Parameters:
input
- the inputregistryLoader
- the registry loader- Returns:
- a new registry with the given RegistryLoader
-
create
public static <I, K, V> SimpleMappedRegistry<K,V> create(Supplier<RegistryLoader<I,Map<K,V>>> registryLoader)Creates a new mapped registry with the givenRegistryLoader
supplier. The input type is not specified here, meaning the loader return type is either predefined, or the registry is populated at a later point.- Type Parameters:
I
- the inputK
- the map keyV
- the map value- Parameters:
registryLoader
- the registry loader supplier- Returns:
- a new registry with the given RegistryLoader supplier
-
create
public static <I, K, V> SimpleMappedRegistry<K,V> create(I input, Supplier<RegistryLoader<I,Map<K,V>>> registryLoader)Creates a new mapped registry with the givenRegistryLoader
and input.- Type Parameters:
I
- the inputK
- the map keyV
- the map value- Parameters:
registryLoader
- the registry loader- Returns:
- a new registry with the given RegistryLoader supplier
-