Search in sources :

Example 1 with DataGenerator

use of net.minecraft.data.DataGenerator 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);
        }
    });
}
Also used : ExistingFileHelper(net.minecraftforge.common.data.ExistingFileHelper) DataGenerator(net.minecraft.data.DataGenerator) BlockTagsProvider(net.minecraft.data.tags.BlockTagsProvider)

Example 2 with DataGenerator

use of net.minecraft.data.DataGenerator in project MinecraftForge by MinecraftForge.

the class NewModelLoaderTest method datagen.

private void datagen(GatherDataEvent event) {
    DataGenerator gen = event.getGenerator();
    if (event.includeClient()) {
        // Let blockstate provider see generated item models by passing its existing file helper
        ItemModelProvider itemModels = new ItemModels(gen, event.getExistingFileHelper());
        gen.addProvider(itemModels);
        gen.addProvider(new BlockStates(gen, itemModels.existingFileHelper));
    }
}
Also used : ItemModelProvider(net.minecraftforge.client.model.generators.ItemModelProvider) DataGenerator(net.minecraft.data.DataGenerator)

Example 3 with DataGenerator

use of net.minecraft.data.DataGenerator 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);
    }
}
Also used : TropicraftItemModelProvider(net.tropicraft.core.client.data.TropicraftItemModelProvider) TropicraftBlockstateProvider(net.tropicraft.core.client.data.TropicraftBlockstateProvider) TropicraftLootTableProvider(net.tropicraft.core.common.data.TropicraftLootTableProvider) ExistingFileHelper(net.minecraftforge.common.data.ExistingFileHelper) TropicraftEntityTypeTagsProvider(net.tropicraft.core.common.data.TropicraftEntityTypeTagsProvider) TropicraftBlockTagsProvider(net.tropicraft.core.common.data.TropicraftBlockTagsProvider) DataGenerator(net.minecraft.data.DataGenerator) TropicraftItemTagsProvider(net.tropicraft.core.common.data.TropicraftItemTagsProvider) TropicraftRecipeProvider(net.tropicraft.core.common.data.TropicraftRecipeProvider) TropicraftLangProvider(net.tropicraft.core.client.data.TropicraftLangProvider)

Example 4 with DataGenerator

use of net.minecraft.data.DataGenerator 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));
    }
}
Also used : ExistingFileHelper(net.minecraftforge.common.data.ExistingFileHelper) ItemTagProvider(knightminer.ceramics.datagen.ItemTagProvider) RecipeProvider(knightminer.ceramics.datagen.RecipeProvider) LootTableProvider(knightminer.ceramics.datagen.LootTableProvider) DataGenerator(net.minecraft.data.DataGenerator) BlockTagProvider(knightminer.ceramics.datagen.BlockTagProvider) FluidTagProvider(knightminer.ceramics.datagen.FluidTagProvider) BlockTagsProvider(net.minecraft.data.BlockTagsProvider)

Example 5 with DataGenerator

use of net.minecraft.data.DataGenerator 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));
    }
}
Also used : ExistingFileHelper(net.minecraftforge.common.data.ExistingFileHelper) ForgeLootTableProvider(net.minecraftforge.common.data.ForgeLootTableProvider) DataGenerator(net.minecraft.data.DataGenerator) ForgeFluidTagsProvider(net.minecraftforge.common.data.ForgeFluidTagsProvider) ForgeItemTagsProvider(net.minecraftforge.common.data.ForgeItemTagsProvider) ForgeBlockTagsProvider(net.minecraftforge.common.data.ForgeBlockTagsProvider) ForgeRecipeProvider(net.minecraftforge.common.data.ForgeRecipeProvider)

Aggregations

DataGenerator (net.minecraft.data.DataGenerator)7 ExistingFileHelper (net.minecraftforge.common.data.ExistingFileHelper)4 ItemModelProvider (net.minecraftforge.client.model.generators.ItemModelProvider)2 SubscribeEvent (net.minecraftforge.eventbus.api.SubscribeEvent)2 GsonBuilder (com.google.gson.GsonBuilder)1 BlockTagProvider (knightminer.ceramics.datagen.BlockTagProvider)1 FluidTagProvider (knightminer.ceramics.datagen.FluidTagProvider)1 ItemTagProvider (knightminer.ceramics.datagen.ItemTagProvider)1 LootTableProvider (knightminer.ceramics.datagen.LootTableProvider)1 RecipeProvider (knightminer.ceramics.datagen.RecipeProvider)1 ItemTransform (net.minecraft.client.renderer.block.model.ItemTransform)1 ItemTransforms (net.minecraft.client.renderer.block.model.ItemTransforms)1 Variant (net.minecraft.client.renderer.block.model.Variant)1 BlockTagsProvider (net.minecraft.data.BlockTagsProvider)1 BlockTagsProvider (net.minecraft.data.tags.BlockTagsProvider)1 BlockTags (net.minecraft.tags.BlockTags)1 ForgeBlockTagsProvider (net.minecraftforge.common.data.ForgeBlockTagsProvider)1 ForgeFluidTagsProvider (net.minecraftforge.common.data.ForgeFluidTagsProvider)1 ForgeItemTagsProvider (net.minecraftforge.common.data.ForgeItemTagsProvider)1 ForgeLootTableProvider (net.minecraftforge.common.data.ForgeLootTableProvider)1