Fabric API

Fabric API

112M Downloads

Data Generation running from other mods as dependencies

A5ho9999 opened this issue ยท 0 comments

commented

When attempting to use a local jar as a dependency I ran into an issue where the Data Generation is being ran twice, once from the local file and then again from the current project. I'm sure I've probably just done something wrong but I haven't been able to find any similar issues.

Steps to reproduce:
1, Create a project and add a local file dependency that has data generation
2. Run data generation

Using Loom 1.6 and Fabric API 0.92.1+1.20.1

fabricApi {
	configureDataGeneration()
}
dependencies {
	minecraft "com.mojang:minecraft:${project.minecraft_version}"
	mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
	modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"

	modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"

	modImplementation files ("libs\\Yeeterite-3.0.0-1.20+.jar")
}
[08:44:33] [main/INFO] (FabricDataGenHelper) Running data generator for brrrrock
[08:44:33] [main/INFO] (Minecraft) Starting provider: Brrrrock (Yeeterite)/Tags for minecraft:item
[08:44:33] [main/INFO] (Minecraft) Brrrrock (Yeeterite)/Tags for minecraft:item finished after 596 ms
[08:44:33] [main/INFO] (Minecraft) Starting provider: Brrrrock (Yeeterite)/Tags for minecraft:block
[08:44:33] [main/INFO] (Minecraft) Brrrrock (Yeeterite)/Tags for minecraft:block finished after 0 ms
[08:44:33] [main/INFO] (Minecraft) Starting provider: Brrrrock (Yeeterite)/Block Loot Tables
[08:44:33] [main/INFO] (Minecraft) Brrrrock (Yeeterite)/Block Loot Tables finished after 86 ms
[08:44:33] [main/INFO] (Minecraft) Starting provider: Brrrrock (Yeeterite)/Recipes
[08:44:34] [main/INFO] (Minecraft) Brrrrock (Yeeterite)/Recipes finished after 135 ms
[08:44:34] [main/INFO] (Minecraft) Starting provider: Brrrrock (Yeeterite)/Model Definitions
[08:44:34] [main/INFO] (Minecraft) Brrrrock (Yeeterite)/Model Definitions finished after 72 ms
[08:44:34] [main/INFO] (Minecraft) Starting provider: Brrrrock (Yeeterite)/Language (en_us)
[08:44:34] [main/INFO] (Minecraft) Brrrrock (Yeeterite)/Language (en_us) finished after 7 ms
[08:44:34] [main/INFO] (Minecraft) Starting provider: Brrrrock (Yeeterite)/Advancements
[08:44:34] [main/INFO] (Minecraft) Brrrrock (Yeeterite)/Advancements finished after 57 ms
[08:44:34] [main/INFO] (Minecraft) All providers took: 958 ms
[08:44:34] [main/INFO] (Minecraft) Caching: total files: 17, old count: 0, new count: 18, removed stale: 0, written: 17
[08:44:34] [main/INFO] (FabricDataGenHelper) Running data generator for brrrrock-extra
[08:44:34] [main/INFO] (Minecraft) Starting provider: Brrrrock+ (Yeeterite Extras)/Model Definitions
[08:44:34] [main/INFO] (Minecraft) Brrrrock+ (Yeeterite Extras)/Model Definitions finished after 42 ms
[08:44:34] [main/INFO] (Minecraft) Starting provider: Brrrrock+ (Yeeterite Extras)/Tags for minecraft:item
[08:44:34] [main/INFO] (Minecraft) Brrrrock+ (Yeeterite Extras)/Tags for minecraft:item finished after 129 ms
[08:44:34] [main/INFO] (Minecraft) Starting provider: Brrrrock+ (Yeeterite Extras)/Tags for minecraft:block
[08:44:34] [main/INFO] (Minecraft) Brrrrock+ (Yeeterite Extras)/Tags for minecraft:block finished after 49 ms
[08:44:34] [main/INFO] (Minecraft) Starting provider: Brrrrock+ (Yeeterite Extras)/Recipes
[08:44:35] [main/INFO] (Minecraft) Brrrrock+ (Yeeterite Extras)/Recipes finished after 315 ms
[08:44:35] [main/INFO] (Minecraft) Starting provider: Brrrrock+ (Yeeterite Extras)/Advancements
[08:44:35] [main/INFO] (Minecraft) Brrrrock+ (Yeeterite Extras)/Advancements finished after 0 ms
[08:44:35] [main/INFO] (Minecraft) Starting provider: Brrrrock+ (Yeeterite Extras)/Language (en_us)
[08:44:35] [main/INFO] (Minecraft) Brrrrock+ (Yeeterite Extras)/Language (en_us) finished after 1 ms
[08:44:35] [main/INFO] (Minecraft) All providers took: 540 ms
[08:44:35] [main/INFO] (Minecraft) Caching: total files: 60, old count: 0, new count: 40, removed stale: 21, written: 39

EDIT:
After testing using maven as well as local files, any mod that is added as a dependency with data generation seems to trigger data generation. This is rather inconvenient as they all override each other and which ever is the last to run will be the generated files.

It seems to be caused by a couple things. The 'newer' system that is using the configureDataGeneration. Rather then the older version through the loom configuration as well as using the default Data Generation Run Configuration, if you manually go and select the runDatagen from the gradle tasks with the loom configuration the issue does not appear.