use of net.minecraftforge.common.data.ExistingFileHelper in project MinecraftForge by MinecraftForge.
the class RemoveTagDatagenTest method onGatherData.
private void onGatherData(GatherDataEvent event) {
DataGenerator generator = event.getGenerator();
ExistingFileHelper helper = event.getExistingFileHelper();
generator.addProvider(new BlockTagsProvider(generator, MODID, helper) {
@SuppressWarnings("unchecked")
@Override
protected void addTags() {
this.tag(TEST_TAG).remove(Blocks.DIRT.getRegistryName()).remove(Blocks.OAK_DOOR.getRegistryName(), Blocks.DARK_OAK_DOOR.getRegistryName()).remove(Blocks.ANVIL).remove(Blocks.BASALT, Blocks.POLISHED_BASALT).remove(BlockTags.BEEHIVES).remove(BlockTags.BANNERS, BlockTags.BEDS);
}
});
}
use of net.minecraftforge.common.data.ExistingFileHelper in project Tropicraft by Tropicraft.
the class Tropicraft method gatherData.
private void gatherData(GatherDataEvent event) {
DataGenerator gen = event.getGenerator();
ExistingFileHelper existingFileHelper = event.getExistingFileHelper();
if (event.includeClient()) {
TropicraftBlockstateProvider blockstates = new TropicraftBlockstateProvider(gen, existingFileHelper);
gen.addProvider(blockstates);
gen.addProvider(new TropicraftItemModelProvider(gen, blockstates.getExistingHelper()));
gen.addProvider(new TropicraftLangProvider(gen));
}
if (event.includeServer()) {
TropicraftBlockTagsProvider blockTags = new TropicraftBlockTagsProvider(gen, existingFileHelper);
gen.addProvider(blockTags);
gen.addProvider(new TropicraftItemTagsProvider(gen, blockTags, existingFileHelper));
gen.addProvider(new TropicraftRecipeProvider(gen));
gen.addProvider(new TropicraftLootTableProvider(gen));
gen.addProvider(new TropicraftEntityTypeTagsProvider(gen, existingFileHelper));
gatherWorldgenData(gen);
}
}
use of net.minecraftforge.common.data.ExistingFileHelper in project Ceramics by KnightMiner.
the class Ceramics method gatherData.
private void gatherData(GatherDataEvent event) {
if (event.includeServer()) {
DataGenerator gen = event.getGenerator();
ExistingFileHelper helper = event.getExistingFileHelper();
BlockTagsProvider blockTags = new BlockTagProvider(gen, helper);
gen.addProvider(blockTags);
gen.addProvider(new ItemTagProvider(gen, blockTags, helper));
gen.addProvider(new FluidTagProvider(gen, helper));
gen.addProvider(new RecipeProvider(gen));
gen.addProvider(new LootTableProvider(gen));
}
}
use of net.minecraftforge.common.data.ExistingFileHelper in project MinecraftForge by MinecraftForge.
the class ForgeMod method gatherData.
public void gatherData(GatherDataEvent event) {
DataGenerator gen = event.getGenerator();
if (event.includeServer()) {
ExistingFileHelper existingFileHelper = event.getExistingFileHelper();
ForgeBlockTagsProvider blockTags = new ForgeBlockTagsProvider(gen, existingFileHelper);
gen.addProvider(blockTags);
gen.addProvider(new ForgeItemTagsProvider(gen, blockTags, existingFileHelper));
gen.addProvider(new ForgeFluidTagsProvider(gen, existingFileHelper));
gen.addProvider(new ForgeRecipeProvider(gen));
gen.addProvider(new ForgeLootTableProvider(gen));
}
}
use of net.minecraftforge.common.data.ExistingFileHelper in project MinecraftForge by MinecraftForge.
the class DatagenModLoader method begin.
public static void begin(final Set<String> mods, final Path path, final Collection<Path> inputs, Collection<Path> existingPacks, Set<String> existingMods, final boolean serverGenerators, final boolean clientGenerators, final boolean devToolGenerators, final boolean reportsGenerator, final boolean structureValidator, final boolean flat, final String assetIndex, final File assetsDir) {
if (mods.contains("minecraft") && mods.size() == 1)
return;
LOGGER.info("Initializing Data Gatherer for mods {}", mods);
runningDataGen = true;
Bootstrap.bootStrap();
dataGeneratorConfig = new GatherDataEvent.DataGeneratorConfig(mods, path, inputs, serverGenerators, clientGenerators, devToolGenerators, reportsGenerator, structureValidator, flat);
ModLoader.get().gatherAndInitializeMods(ModWorkManager.syncExecutor(), ModWorkManager.parallelExecutor(), () -> {
});
if (!mods.contains("forge")) {
// If we aren't generating data for forge, automatically add forge as an existing so mods can access forge's data
existingMods.add("forge");
}
existingFileHelper = new ExistingFileHelper(existingPacks, existingMods, structureValidator, assetIndex, assetsDir);
ModLoader.get().runEventGenerator(mc -> new GatherDataEvent(mc, dataGeneratorConfig.makeGenerator(p -> dataGeneratorConfig.isFlat() ? p : p.resolve(mc.getModId()), dataGeneratorConfig.getMods().contains(mc.getModId())), dataGeneratorConfig, existingFileHelper));
dataGeneratorConfig.runAll();
}
Aggregations