Interface DataGenerationConstructor

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 DataGenerationConstructor
A mod's data generation entry point, written once in common code. It's only created when data is generated, so providers may use client-only classes (models...).

Hooking it up:

  • Fabric: list the class under the "coolcatlib:datagen" entrypoint, and net.ixdarklord.coolcatcore.api.core.fabric.FabricDataGenerationEntrypoint under "fabric-datagen".
  • NeoForge: dataGeneration(MyModData::new) in a NeoForgeModEntrypoint.
  • Anywhere else: construct(String, Supplier) while mods are constructed.
  • Method Details

    • construct

      static void construct(String modId, Supplier<? extends DataGenerationConstructor> factory)
      Registers a mod's data generation entry point. The factory is only called when data is generated for that mod.
    • onGatherData

      void onGatherData(DataGenerationContext context)
      Adds the mod's data providers.