Interface DataGeneratorEntrypoint

Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface DataGeneratorEntrypoint
An entry point for data generation.

In fabric.mod.json, the entrypoint is defined with fabric-datagen key.

See Also:
  • Method Details

    • onInitializeDataGenerator

      void onInitializeDataGenerator(FabricDataGenerator fabricDataGenerator)
      Register DataProvider with the FabricDataGenerator during this entrypoint.
      Parameters:
      fabricDataGenerator - The FabricDataGenerator instance
    • getEffectiveModId

      @Nullable default @Nullable String getEffectiveModId()
      Returns the mod ID of the mod the data is being generated for. A null return will run the data generator using the mod ID that registered the current entrypoint.
      Returns:
      a String or null
      Throws:
      RuntimeException - If the mod ID does not exist.
    • buildRegistry

      default void buildRegistry(RegistryBuilder registryBuilder)
      Builds a registry containing dynamic registry entries to be generated. Users should call RegistryBuilder.addRegistry(RegistryKey, RegistryBuilder.BootstrapFunction) to register a bootstrap function, which adds registry entries to be generated.

      This is invoked asynchronously.

      Parameters:
      registryBuilder - a RegistryBuilder instance
    • addJsonKeySortOrders

      default void addJsonKeySortOrders(JsonKeySortOrderCallback callback)
      Provides a callback for setting the sort priority of object keys in generated JSON files.
      Parameters:
      callback - a callback for setting the sort priority for a given key