Interface RegistryAdapter<K,V>

Type Parameters:
K - The type of key used by the registry.
V - The type of value being registered.
All Known Implementing Classes:
BlockRegistryAdapter, CommandArgumentAdapter, CreativeModeTabAdapter, GameRegistryAdapter, GenericRegistryAdapter, IngredientTypeAdapter, ItemRegistryAdapter, MenuTypeAdapter, PotPatternAdapter, RecipeTypeAdapter, SoundEventAdapter

public interface RegistryAdapter<K,V>
Provides a loader agnostic interface for registering content.
  • Method Details

    • add

      default RegistryReference<K,V> add(String key, V value)
      Adds a value to the registry. Values are not necessarily registered immediately.
      Parameters:
      key - The ID to register the value under. This ID only needs to be unique within your namespace.
      value - The value to register.
      Returns:
      A reference to the registry entry.
    • add

      RegistryReference<K,V> add(String key, Supplier<V> value)
      Adds a value to the registry. Values are not necessarily registered immediately.
      Parameters:
      key - The ID to register the value under. This ID only needs to be unique within your namespace.
      value - A supplier that produces the value to register.
      Returns:
      A reference to the registry entry.