mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-19 03:49:14 +00:00
Skip running the datagenerator on unrequested mods.
Add a run config for the data task for modders to use Signed-off-by: cpw <[email protected]>
This commit is contained in:
3 files changed
+16
-3
No files matched your search
@@ -231,6 +231,6 @@ public class ModLoader
|
||||
}
|
||||
|
||||
public Function<ModContainer, ModLifecycleEvent> getDataGeneratorEvent() {
|
||||
return mc -> new GatherDataEvent(mc, dataGeneratorConfig.makeGenerator(p->dataGeneratorConfig.getMods().size() == 1 ? p : p.resolve(mc.getModId())), dataGeneratorConfig);
|
||||
return mc -> new GatherDataEvent(mc, dataGeneratorConfig.makeGenerator(p->dataGeneratorConfig.getMods().size() == 1 ? p : p.resolve(mc.getModId()), dataGeneratorConfig.getMods().contains(mc.getModId())), dataGeneratorConfig);
|
||||
}
|
||||
}
|
||||
@@ -74,9 +74,9 @@ public class GatherDataEvent extends ModLifecycleEvent
|
||||
return mods;
|
||||
}
|
||||
|
||||
public DataGenerator makeGenerator(final Function<Path,Path> pathEnhancer) {
|
||||
public DataGenerator makeGenerator(final Function<Path,Path> pathEnhancer, final boolean shouldExecute) {
|
||||
final DataGenerator generator = new DataGenerator(pathEnhancer.apply(path), inputs);
|
||||
generators.add(generator);
|
||||
if (shouldExecute) generators.add(generator);
|
||||
return generator;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user