Class RegistryHolder<V>

java.lang.Object
earth.terrarium.botarium.common.registry.RegistryHolder<V>

public class RegistryHolder<V> extends Object
  • Constructor Details

    • RegistryHolder

      @ImplementedByExtension public RegistryHolder(net.minecraft.core.Registry<V> registry, String modid)
      Parameters:
      registry - The Registry that will be used to register the entries under.
      modid - The id of the mod that all entries in this registry will get registered under.
  • Method Details

    • register

      @ImplementedByExtension public <T extends V> Supplier<T> register(String id, Supplier<T> registry)
      Registers an entry to the registry.
      Parameters:
      id - The id of the entry.
      registry - The Supplier that will be registered into the registry with the id and the mod id provided in the constructor.
      Returns:
      An instance of a Supplier that holds the entry that was registered.
    • getRegistries

      @ImplementedByExtension public Collection<? extends Supplier<V>> getRegistries()
      Returns:
      A Collection of all the entries in this registry as suppliers.
    • initialize

      @ImplementedByExtension public void initialize()
      Registers all entries in this registry. Should be called in your mod's initialization method.