Package org.moddingx.libx.datagen
Class DatagenSystem
java.lang.Object
org.moddingx.libx.datagen.DatagenSystem
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addDataProvider
(Function<DatagenContext, net.minecraft.data.DataProvider> provider) Adds a provider to run in thedatagen stage
.void
addDataProvider
(PackTarget target, Function<DatagenContext, net.minecraft.data.DataProvider> provider) Adds a provider to run in thedatagen stage
.void
Adds a provider to run in theextension setup stage
.void
addExtensionProvider
(PackTarget target, Function<DatagenContext, RegistryProvider> provider) Adds a provider to run in theextension setup stage
.void
Adds a provider to run in theregistry setup stage
.void
addRegistryProvider
(PackTarget target, Function<DatagenContext, RegistryProvider> provider) Adds a provider to run in theregistry setup stage
.static void
create
(ModX mod, Consumer<DatagenSystem> configure) Registers a datagen system for the given mod and executes the provided configuration action when running datagen.dynamic
(String id, net.minecraft.server.packs.PackType type, PackTarget... parents) Creates a pack target for a LibX dynamic pack.static Set<net.minecraft.resources.ResourceKey<? extends net.minecraft.core.Registry<?>>>
Gets a set of all extension.registries.net.minecraftforge.common.data.ExistingFileHelper
join
(PackTarget resources, PackTarget data) Joins two pack targets, using one for client resource output and the other one for server data output.The main output path.The main pack target.makePackTarget
(String name, PackTarget... parents) Creates a new builder for aPackTarget
.mod()
nestedDatapack
(net.minecraft.resources.ResourceLocation id, PackTarget... parents) Creates a pack target for a vanilla-style nested datapack inside the first given parent.static void
registerExtensionRegistry
(net.minecraft.resources.ResourceKey<? extends net.minecraft.core.Registry<?>> registryKey) Marks a registry as an extension registry.void
setResourceRoot
(String root) Sets the resource root relative to thegame dir
.
-
Method Details
-
registerExtensionRegistry
public static void registerExtensionRegistry(net.minecraft.resources.ResourceKey<? extends net.minecraft.core.Registry<?>> registryKey) Marks a registry as an extension registry. An extension registry is a registry, where the id of the elements reference the id inside another registry (for example LibXbiome surface
). Extension registries are frozen later during datagen to allow them access to frozen non-extension registries while being populated.- See Also:
-
extensionRegistries
public static Set<net.minecraft.resources.ResourceKey<? extends net.minecraft.core.Registry<?>>> extensionRegistries()Gets a set of all extension.registries.- See Also:
-
create
Registers a datagen system for the given mod and executes the provided configuration action when running datagen. Calling this method multiple times for the same mod will only create a single datagen system but invoke all configuration in order. -
mod
-
fileHelper
public net.minecraftforge.common.data.ExistingFileHelper fileHelper() -
mainTarget
The main pack target. -
mainOutput
The main output path. UsePackTarget.path(PackType)
instead of this whenever possible. -
setResourceRoot
Sets the resource root relative to thegame dir
. This is used to allow resource lookup indynamic
pack targets. -
nestedDatapack
public PackTarget nestedDatapack(net.minecraft.resources.ResourceLocation id, PackTarget... parents) Creates a pack target for a vanilla-style nested datapack inside the first given parent. Client resources can't be output on this target. -
dynamic
public PackTarget dynamic(String id, net.minecraft.server.packs.PackType type, PackTarget... parents) Creates a pack target for a LibX dynamic pack. For resource packs, server data output defaults to the first parent, for data packs, client resource output defaults to the first parent. -
join
Joins two pack targets, using one for client resource output and the other one for server data output. -
makePackTarget
Creates a new builder for aPackTarget
. The registries for this pack target will contain all elements from the parents registries. The output locations default to the output locations of the first parent. If no parents are given,mainTarget()
is assumed. -
addRegistryProvider
Adds a provider to run in theregistry setup stage
. -
addRegistryProvider
public void addRegistryProvider(PackTarget target, Function<DatagenContext, RegistryProvider> provider) Adds a provider to run in theregistry setup stage
. -
addExtensionProvider
Adds a provider to run in theextension setup stage
. -
addExtensionProvider
public void addExtensionProvider(PackTarget target, Function<DatagenContext, RegistryProvider> provider) Adds a provider to run in theextension setup stage
. -
addDataProvider
Adds a provider to run in thedatagen stage
. -
addDataProvider
public void addDataProvider(PackTarget target, Function<DatagenContext, net.minecraft.data.DataProvider> provider) Adds a provider to run in thedatagen stage
.
-