Class DatagenContext

java.lang.Object
org.moddingx.libx.datagen.DatagenContext

public abstract class DatagenContext extends Object
Context for creation of data and registry providers.
  • Constructor Details

  • Method Details

    • stage

      public DatagenStage stage()
      Gets the DatagenStage the provider runs in.
    • mod

      public ModX mod()
      Gets the mod, the provider is generating data for.
    • system

      public DatagenSystem system()
      Gets the associated DatagenSystem.
    • fileHelper

      public net.minecraftforge.common.data.ExistingFileHelper fileHelper()
      Gets the ExistingFileHelper.
    • target

      public PackTarget target()
      Gets the PackTarget for output. This may only be used during datagen stage.
    • output

      public net.minecraft.data.PackOutput output()
      Gets the PackOutput for output. This may only be used during datagen stage.
    • registries

      public RegistrySet registries()
      Gets the RegistrySet used for this provider.
    • findRegistryProvider

      public abstract <T extends RegistryProvider> T findRegistryProvider(Class<T> cls)
      Queries a RegistryProvider 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

      public abstract <T extends net.minecraft.data.DataProvider> T findDataProvider(Class<T> cls)
      Queries a DataProvider 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 the datagen stage that runs on the same PackTarget as this provider.