Interface RegistrySet


public interface RegistrySet
Provides access to datagen registries.
  • Method Summary

    Modifier and Type
    Method
    Description
    <T> net.minecraft.resources.ResourceKey<? extends net.minecraft.core.Registry<T>>
    findRegistryFor(net.minecraft.core.Holder.Reference<T> holder)
    Gets the target registry for holders created from registries returned by writableRegistry(ResourceKey).
    <T> net.minecraft.core.Registry<T>
    registry(net.minecraft.resources.ResourceKey<? extends net.minecraft.core.Registry<T>> registryKey)
    Gets a registry from the registry set.
    net.minecraft.core.RegistryAccess
    Gets a RegistryAccess for this registry set.
    <T> net.minecraft.core.WritableRegistry<T>
    writableRegistry(net.minecraft.resources.ResourceKey<? extends net.minecraft.core.Registry<T>> registryKey)
    Gets a writable registry from the registry set.
  • Method Details

    • registry

      <T> net.minecraft.core.Registry<T> registry(net.minecraft.resources.ResourceKey<? extends net.minecraft.core.Registry<T>> registryKey)
      Gets a registry from the registry set.
    • writableRegistry

      <T> net.minecraft.core.WritableRegistry<T> writableRegistry(net.minecraft.resources.ResourceKey<? extends net.minecraft.core.Registry<T>> registryKey)
      Gets a writable registry from the registry set. This only succeeds, if the registry is a datapack registry and this method is called in the correct stage. The registries returned by this method can create intrusive holders.
      See Also:
    • registryAccess

      net.minecraft.core.RegistryAccess registryAccess()
      Gets a RegistryAccess for this registry set. This can only be used during the datagen stage.
    • findRegistryFor

      @Nullable <T> net.minecraft.resources.ResourceKey<? extends net.minecraft.core.Registry<T>> findRegistryFor(net.minecraft.core.Holder.Reference<T> holder)
      Gets the target registry for holders created from registries returned by writableRegistry(ResourceKey). If a holder is unknown to the system, returns null.