Package org.moddingx.libx.datagen
Interface RegistrySet
public interface RegistrySet
Provides access to datagen registries.
-
Method Summary
Modifier and TypeMethodDescription<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 bywritableRegistry(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 aRegistryAccess
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 correctstage
. The registries returned by this method can createintrusive holders
.- See Also:
-
registryAccess
net.minecraft.core.RegistryAccess registryAccess()Gets aRegistryAccess
for this registry set. This can only be used during thedatagen 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 bywritableRegistry(ResourceKey)
. If a holder is unknown to the system, returnsnull
.
-