Class SimpleRegistry<M>

java.lang.Object
org.geysermc.geyser.registry.Registry<M>
org.geysermc.geyser.registry.SimpleRegistry<M>
Type Parameters:
M - the value being held by the registry

public class SimpleRegistry<M> extends Registry<M>
A simple registry with no defined mapping or input type. Designed to allow for simple registrations of any given type without restrictions on what the input or output can be.
  • Method Details

    • create

      public static <I,​ M> SimpleRegistry<M> create(Supplier<RegistryLoader<I,​M>> registryLoader)
      Creates a new 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 type
      M - the returned mappings type
      Parameters:
      registryLoader - the registry loader supplier
      Returns:
      a new registry with the given RegistryLoader supplier
    • create

      public static <I,​ M> SimpleRegistry<M> create(I input, Supplier<RegistryLoader<I,​M>> registryLoader)
      Creates a new registry with the given RegistryLoader supplier and input.
      Type Parameters:
      I - the input type
      M - the returned mappings type
      Parameters:
      input - the input
      registryLoader - the registry loader supplier
      Returns:
      a new registry with the given RegistryLoader supplier
    • create

      public static <I,​ M> SimpleRegistry<M> create(RegistryLoader<I,​M> registryLoader)
      Creates a new 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 type
      M - the returned mappings type
      Parameters:
      registryLoader - the registry loader
      Returns:
      a new registry with the given RegistryLoader supplier
    • create

      public static <I,​ M> SimpleRegistry<M> create(I input, RegistryLoader<I,​M> registryLoader)
      Creates a new registry with the given RegistryLoader and input.
      Type Parameters:
      I - the input type
      M - the returned mappings type
      Parameters:
      input - the input
      registryLoader - the registry loader
      Returns:
      a new registry with the given RegistryLoader supplier