Class SimpleMappedDeferredRegistry<K,V>

java.lang.Object
org.geysermc.geyser.registry.AbstractMappedDeferredRegistry<K,V,Map<K,V>,SimpleMappedRegistry<K,V>>
org.geysermc.geyser.registry.SimpleMappedDeferredRegistry<K,V>

public class SimpleMappedDeferredRegistry<K,V> extends AbstractMappedDeferredRegistry<K,V,Map<K,V>,SimpleMappedRegistry<K,V>>
  • Constructor Details

  • Method Details

    • create

      public static <I, K, V> SimpleMappedDeferredRegistry<K,V> create(Function<RegistryLoader<I,Map<K,V>>,SimpleMappedRegistry<K,V>> registryLoader, RegistryLoader<I,Map<K,V>> deferredLoader)
      Creates a new deferred registry.
      Type Parameters:
      I - the input type
      Parameters:
      registryLoader - the registry loader
      deferredLoader - the deferred loader
      Returns:
      the new deferred registry
    • create

      public static <I, K, V> SimpleMappedDeferredRegistry<K,V> create(Function<RegistryLoader<I,Map<K,V>>,SimpleMappedRegistry<K,V>> registryLoader, Supplier<RegistryLoader<I,Map<K,V>>> deferredLoader)
      Creates a new deferred registry.
      Type Parameters:
      I - the input type
      Parameters:
      registryLoader - the registry loader
      deferredLoader - the deferred loader
      Returns:
      the new deferred registry
    • create

      public static <I, K, V> SimpleMappedDeferredRegistry<K,V> create(I input, org.geysermc.geyser.registry.DeferredRegistry.RegistryInitializer<Map<K,V>,SimpleMappedRegistry<K,V>> registryInitializer, RegistryLoader<I,Map<K,V>> deferredLoader)
      Creates a new deferred registry.
      Type Parameters:
      I - the input type
      Parameters:
      registryInitializer - the registry initializer
      deferredLoader - the deferred loader
      Returns:
      the new deferred registry
    • create

      public static <I, K, V> SimpleMappedDeferredRegistry<K,V> create(I input, org.geysermc.geyser.registry.DeferredRegistry.RegistryInitializer<Map<K,V>,SimpleMappedRegistry<K,V>> registryInitializer, Supplier<RegistryLoader<I,Map<K,V>>> deferredLoader)
      Creates a new deferred registry.
      Type Parameters:
      I - the input type
      Parameters:
      registryInitializer - the registry initializer
      deferredLoader - the deferred loader
      Returns:
      the new deferred registry
    • create

      public static <I, K, V> SimpleMappedDeferredRegistry<K,V> create(I input, RegistryLoader<I,Map<K,V>> deferredLoader)
      Creates a new deferred registry.
      Type Parameters:
      I - the input type
      Parameters:
      deferredLoader - the deferred loader
      Returns:
      the new deferred registry
    • create

      public static <I, K, V> SimpleMappedDeferredRegistry<K,V> create(I input, Supplier<RegistryLoader<I,Map<K,V>>> deferredLoader)
      Creates a new deferred registry.
      Type Parameters:
      I - the input type
      Parameters:
      deferredLoader - the deferred loader
      Returns:
      the new deferred registry
    • backingRegistry

      protected SimpleMappedRegistry<K,V> backingRegistry()
    • get

      public Map<K,V> get()
      Gets the underlying value held by this registry.
      Returns:
      the underlying value held by this registry
      Throws:
      IllegalStateException - if this deferred registry has not been loaded yet
    • set

      public void set(Map<K,V> mappings)
    • register

      public void register(Consumer<Map<K,V>> consumer)
      Registers what is specified in the given Consumer into the underlying value.
      Parameters:
      consumer - the consumer
      Throws:
      IllegalStateException - if this deferred registry has not been loaded yet
    • load

      public void load()
      Loads the registry.
    • loaded

      public boolean loaded()
      Whether this registry was loaded.