Class FabricDataGenerator

java.lang.Object
net.minecraft.data.DataGenerator
net.fabricmc.fabric.api.datagen.v1.FabricDataGenerator

public final class FabricDataGenerator extends net.minecraft.data.DataGenerator
An extension to vanilla's DataGenerator providing mod specific data, and helper functions.
  • Nested Class Summary

    Nested classes/interfaces inherited from class net.minecraft.data.DataGenerator

    net.minecraft.data.DataGenerator.OutputType, net.minecraft.data.DataGenerator.PathResolver
  • Constructor Summary

    Constructors
    Constructor
    Description
    FabricDataGenerator(Path output, net.fabricmc.loader.api.ModContainer mod, boolean strictValidation)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    <P extends net.minecraft.data.DataProvider>
    P
    addProvider(boolean include, Function<FabricDataGenerator,P> provider)
    Helper overloaded method to aid with registering a DataProvider that has a single argument constructor for a FabricDataGenerator.
    <P extends net.minecraft.data.DataProvider>
    P
    Helper overloaded method to aid with registering a DataProvider that has a single argument constructor for a FabricDataGenerator.
    void
    addProvider(net.minecraft.data.DataProvider dataProvider)
    Helper overloaded method to aid with registering a DataProvider.
    net.fabricmc.loader.api.ModContainer
    Returns the ModContainer for the mod that this data generator has been created for.
    Returns the mod ID for the mod that this data generator has been created for.
    boolean
    When enabled data providers can do strict validation to ensure that all entries have data generated for them.

    Methods inherited from class net.minecraft.data.DataGenerator

    addProvider, createPathResolver, getInputs, getOutput, resolveRootDirectoryPath, run

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • FabricDataGenerator

      @Internal public FabricDataGenerator(Path output, net.fabricmc.loader.api.ModContainer mod, boolean strictValidation)
  • Method Details

    • addProvider

      public <P extends net.minecraft.data.DataProvider> P addProvider(Function<FabricDataGenerator,P> provider)
      Helper overloaded method to aid with registering a DataProvider that has a single argument constructor for a FabricDataGenerator.
      Returns:
      The DataProvider
    • addProvider

      public <P extends net.minecraft.data.DataProvider> P addProvider(boolean include, Function<FabricDataGenerator,P> provider)
      Helper overloaded method to aid with registering a DataProvider that has a single argument constructor for a FabricDataGenerator.
      Returns:
      The DataProvider
    • addProvider

      public void addProvider(net.minecraft.data.DataProvider dataProvider)
      Helper overloaded method to aid with registering a DataProvider.
    • getModContainer

      public net.fabricmc.loader.api.ModContainer getModContainer()
      Returns the ModContainer for the mod that this data generator has been created for.
      Returns:
      a ModContainer instance
    • getModId

      public String getModId()
      Returns the mod ID for the mod that this data generator has been created for.
      Returns:
      a mod ID
    • isStrictValidationEnabled

      public boolean isStrictValidationEnabled()
      When enabled data providers can do strict validation to ensure that all entries have data generated for them.
      Returns:
      if strict validation should be enabled