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 key
V - the value

public class SimpleMappedRegistry<K,​V> extends AbstractMappedRegistry<K,​V,​Map<K,​V>>
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.
  • Constructor Details

    • SimpleMappedRegistry

      protected SimpleMappedRegistry(I input, RegistryLoader<I,​Map<K,​V>> registryLoader)
  • 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 given RegistryLoader. 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 input
      K - the map key
      V - 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 given RegistryLoader and input.
      Type Parameters:
      I - the input
      K - the map key
      V - the map value
      Parameters:
      input - the input
      registryLoader - 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 given RegistryLoader 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 input
      K - the map key
      V - 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 given RegistryLoader and input.
      Type Parameters:
      I - the input
      K - the map key
      V - the map value
      Parameters:
      registryLoader - the registry loader
      Returns:
      a new registry with the given RegistryLoader supplier