Package org.moddingx.libx.datagen
Class DatagenContext
java.lang.Object
org.moddingx.libx.datagen.DatagenContext
Context for creation of data and registry providers.
-
Constructor Summary
ModifierConstructorDescriptionprotected
DatagenContext
(DatagenStage stage, DatagenSystem system, PackTarget target) -
Method Summary
Modifier and TypeMethodDescriptionabstract void
addAdditionalProvider
(Function<DatagenContext, net.minecraft.data.DataProvider> provider) Adds an additional provider for thedatagen stage
that runs on the samePackTarget
as this provider.net.minecraftforge.common.data.ExistingFileHelper
Gets theExistingFileHelper
.abstract <T extends net.minecraft.data.DataProvider>
TfindDataProvider
(Class<T> cls) Queries aDataProvider
by class.abstract <T extends RegistryProvider>
TfindRegistryProvider
(Class<T> cls) Queries aRegistryProvider
by class.mod()
Gets the mod, the provider is generating data for.net.minecraft.data.PackOutput
output()
Gets thePackOutput
for output.Gets theRegistrySet
used for this provider.stage()
Gets theDatagenStage
the provider runs in.system()
Gets the associatedDatagenSystem
.target()
Gets thePackTarget
for output.
-
Constructor Details
-
DatagenContext
-
-
Method Details
-
stage
Gets theDatagenStage
the provider runs in. -
mod
Gets the mod, the provider is generating data for. -
system
Gets the associatedDatagenSystem
. -
fileHelper
public net.minecraftforge.common.data.ExistingFileHelper fileHelper()Gets theExistingFileHelper
. -
target
Gets thePackTarget
for output. This may only be used duringdatagen stage
. -
output
public net.minecraft.data.PackOutput output()Gets thePackOutput
for output. This may only be used duringdatagen stage
. -
registries
Gets theRegistrySet
used for this provider. -
findRegistryProvider
Queries aRegistryProvider
by class. This provider must have been registered before and there may only be a single provider of that class. It's impossible to lookup providers from later stages. -
findDataProvider
Queries aDataProvider
by class. This provider must have been registered before and there may only be a single provider of that class. It's impossible to lookup providers from later stages. -
addAdditionalProvider
public abstract void addAdditionalProvider(Function<DatagenContext, net.minecraft.data.DataProvider> provider) Adds an additional provider for thedatagen stage
that runs on the samePackTarget
as this provider.
-