Search in sources :

Example 1 with TinkerPartSpriteProvider

use of slimeknights.tconstruct.tools.data.sprite.TinkerPartSpriteProvider in project Materialis by RCXcrafter.

the class Materialis method gatherData.

/*private void enqueueIMC(final InterModEnqueueEvent event) {
		// some example code to dispatch IMC to another mod
		InterModComms.sendTo("examplemod", "helloworld", () -> { LOGGER.info("Hello world from the MDK"); return "Hello world";});
	}

	private void processIMC(final InterModProcessEvent event) {
		// some example code to receive and process InterModComms from other mods
		LOGGER.info("Got IMC {}", event.getIMCStream().
				map(m->m.getMessageSupplier().get()).
				collect(Collectors.toList()));
	}

	// You can use SubscribeEvent and let the Event Bus discover methods to call
	@SubscribeEvent
	public void onServerStarting(FMLServerStartingEvent event) {
		// do something when the server starts
		LOGGER.info("HELLO from server starting");
	}

	// You can use EventBusSubscriber to automatically subscribe events on the contained class (this is subscribing to the MOD
	// Event bus for receiving Registry Events)
	@Mod.EventBusSubscriber(bus=Mod.EventBusSubscriber.Bus.MOD)
	public static class RegistryEvents {
		@SubscribeEvent
		public static void onBlocksRegistry(final RegistryEvent.Register<Block> blockRegistryEvent) {
			// register a new block here
			LOGGER.info("HELLO from Register Block");
		}
	}*/
@SubscribeEvent
public static void gatherData(GatherDataEvent event) {
    GSON = new GsonBuilder().registerTypeAdapter(Variant.class, new Variant.Deserializer()).registerTypeAdapter(ItemCameraTransforms.class, new ItemCameraTransforms.Deserializer()).registerTypeAdapter(ItemTransformVec3f.class, new ItemTransformVec3f.Deserializer()).create();
    DataGenerator gen = event.getGenerator();
    if (event.includeClient()) {
        gen.addProvider(new MaterialisLang(gen));
        ExistingFileHelper existingFileHelper = event.getExistingFileHelper();
        ItemModelProvider itemModels = new MaterialisItemModels(gen, existingFileHelper);
        gen.addProvider(itemModels);
        gen.addProvider(new MaterialisBlockStates(gen, existingFileHelper));
        MaterialisMaterialTextures materialSprites = new MaterialisMaterialTextures();
        MaterialisPartTextures partSprites = new MaterialisPartTextures();
        TinkerMaterialSpriteProvider tinkerMaterialSprites = new TinkerMaterialSpriteProvider();
        gen.addProvider(new MaterialisRenderInfo(gen, materialSprites));
        gen.addProvider(new GeneratorPartTextureJsonGenerator(gen, Materialis.modID, partSprites));
        // generate tinkers parts with materialis materials
        gen.addProvider(new MaterialPartTextureGenerator(gen, existingFileHelper, new TinkerPartSpriteProvider(), materialSprites));
        // generate materialis parts with tinkers and materialis materials
        gen.addProvider(new MaterialPartTextureGenerator(gen, existingFileHelper, partSprites, materialSprites, tinkerMaterialSprites));
    }
    if (event.includeServer()) {
        gen.addProvider(new MaterialisLootTables(gen));
        gen.addProvider(new MaterialisRecipes(gen));
        BlockTagsProvider blockTags = new MaterialisBlockTags(gen, event.getExistingFileHelper());
        gen.addProvider(blockTags);
        gen.addProvider(new MaterialisItemTags(gen, blockTags, event.getExistingFileHelper()));
        gen.addProvider(new MaterialisFluidTags(gen, event.getExistingFileHelper()));
        AbstractMaterialDataProvider materials = new MaterialisMaterials(gen);
        gen.addProvider(materials);
        gen.addProvider(new MaterialisMaterialStats(gen, materials));
        gen.addProvider(new MaterialisMaterialTraits(gen, materials));
        gen.addProvider(new MaterialisToolDefinitions(gen));
        gen.addProvider(new MaterialisToolSlotLayouts(gen));
    }
}
Also used : MaterialisToolDefinitions(com.rcx.materialis.datagen.MaterialisToolDefinitions) MaterialisRenderInfo(com.rcx.materialis.datagen.MaterialisRenderInfo) TinkerMaterialSpriteProvider(slimeknights.tconstruct.tools.data.sprite.TinkerMaterialSpriteProvider) MaterialisItemTags(com.rcx.materialis.datagen.MaterialisItemTags) MaterialPartTextureGenerator(slimeknights.tconstruct.library.client.data.material.MaterialPartTextureGenerator) BlockTagsProvider(net.minecraft.data.BlockTagsProvider) MaterialisFluidTags(com.rcx.materialis.datagen.MaterialisFluidTags) MaterialisLang(com.rcx.materialis.datagen.MaterialisLang) ItemCameraTransforms(net.minecraft.client.renderer.model.ItemCameraTransforms) MaterialisBlockStates(com.rcx.materialis.datagen.MaterialisBlockStates) ExistingFileHelper(net.minecraftforge.common.data.ExistingFileHelper) MaterialisItemModels(com.rcx.materialis.datagen.MaterialisItemModels) MaterialisBlockTags(com.rcx.materialis.datagen.MaterialisBlockTags) MaterialisPartTextures(com.rcx.materialis.datagen.MaterialisPartTextures) MaterialisMaterials(com.rcx.materialis.datagen.MaterialisMaterials) MaterialisToolSlotLayouts(com.rcx.materialis.datagen.MaterialisToolSlotLayouts) ItemModelProvider(net.minecraftforge.client.model.generators.ItemModelProvider) GsonBuilder(com.google.gson.GsonBuilder) AbstractMaterialDataProvider(slimeknights.tconstruct.library.data.material.AbstractMaterialDataProvider) MaterialisMaterialTraits(com.rcx.materialis.datagen.MaterialisMaterials.MaterialisMaterialTraits) MaterialisMaterialTextures(com.rcx.materialis.datagen.MaterialisMaterialTextures) MaterialisRecipes(com.rcx.materialis.datagen.MaterialisRecipes) Variant(net.minecraft.client.renderer.model.Variant) MaterialisMaterialStats(com.rcx.materialis.datagen.MaterialisMaterials.MaterialisMaterialStats) DataGenerator(net.minecraft.data.DataGenerator) ItemTransformVec3f(net.minecraft.client.renderer.model.ItemTransformVec3f) MaterialisLootTables(com.rcx.materialis.datagen.MaterialisLootTables) GeneratorPartTextureJsonGenerator(slimeknights.tconstruct.library.client.data.material.GeneratorPartTextureJsonGenerator) TinkerPartSpriteProvider(slimeknights.tconstruct.tools.data.sprite.TinkerPartSpriteProvider) SubscribeEvent(net.minecraftforge.eventbus.api.SubscribeEvent)

Example 2 with TinkerPartSpriteProvider

use of slimeknights.tconstruct.tools.data.sprite.TinkerPartSpriteProvider in project TinkersConstruct by SlimeKnights.

the class TinkerTools method gatherData.

@SubscribeEvent
void gatherData(final GatherDataEvent event) {
    DataGenerator generator = event.getGenerator();
    if (event.includeServer()) {
        generator.addProvider(new ToolsRecipeProvider(generator));
        generator.addProvider(new MaterialRecipeProvider(generator));
        generator.addProvider(new ModifierRecipeProvider(generator));
        MaterialDataProvider materials = new MaterialDataProvider(generator);
        generator.addProvider(materials);
        generator.addProvider(new MaterialStatsDataProvider(generator, materials));
        generator.addProvider(new MaterialTraitsDataProvider(generator, materials));
        generator.addProvider(new ToolDefinitionDataProvider(generator));
        generator.addProvider(new StationSlotLayoutProvider(generator));
    }
    if (event.includeClient()) {
        ExistingFileHelper existingFileHelper = event.getExistingFileHelper();
        TinkerMaterialSpriteProvider materialSprites = new TinkerMaterialSpriteProvider();
        TinkerPartSpriteProvider partSprites = new TinkerPartSpriteProvider();
        generator.addProvider(new MaterialRenderInfoProvider(generator, materialSprites));
        generator.addProvider(new GeneratorPartTextureJsonGenerator(generator, TConstruct.MOD_ID, partSprites));
        generator.addProvider(new MaterialPartTextureGenerator(generator, existingFileHelper, partSprites, materialSprites));
    }
}
Also used : TinkerMaterialSpriteProvider(slimeknights.tconstruct.tools.data.sprite.TinkerMaterialSpriteProvider) MaterialDataProvider(slimeknights.tconstruct.tools.data.material.MaterialDataProvider) MaterialPartTextureGenerator(slimeknights.tconstruct.library.client.data.material.MaterialPartTextureGenerator) ToolDefinitionDataProvider(slimeknights.tconstruct.tools.data.ToolDefinitionDataProvider) ExistingFileHelper(net.minecraftforge.common.data.ExistingFileHelper) MaterialRecipeProvider(slimeknights.tconstruct.tools.data.material.MaterialRecipeProvider) DataGenerator(net.minecraft.data.DataGenerator) MaterialRenderInfoProvider(slimeknights.tconstruct.tools.data.material.MaterialRenderInfoProvider) ModifierRecipeProvider(slimeknights.tconstruct.tools.data.ModifierRecipeProvider) MaterialStatsDataProvider(slimeknights.tconstruct.tools.data.material.MaterialStatsDataProvider) MaterialTraitsDataProvider(slimeknights.tconstruct.tools.data.material.MaterialTraitsDataProvider) ToolsRecipeProvider(slimeknights.tconstruct.tools.data.ToolsRecipeProvider) StationSlotLayoutProvider(slimeknights.tconstruct.tools.data.StationSlotLayoutProvider) GeneratorPartTextureJsonGenerator(slimeknights.tconstruct.library.client.data.material.GeneratorPartTextureJsonGenerator) TinkerPartSpriteProvider(slimeknights.tconstruct.tools.data.sprite.TinkerPartSpriteProvider) SubscribeEvent(net.minecraftforge.eventbus.api.SubscribeEvent)

Aggregations

DataGenerator (net.minecraft.data.DataGenerator)2 ExistingFileHelper (net.minecraftforge.common.data.ExistingFileHelper)2 SubscribeEvent (net.minecraftforge.eventbus.api.SubscribeEvent)2 GeneratorPartTextureJsonGenerator (slimeknights.tconstruct.library.client.data.material.GeneratorPartTextureJsonGenerator)2 MaterialPartTextureGenerator (slimeknights.tconstruct.library.client.data.material.MaterialPartTextureGenerator)2 TinkerMaterialSpriteProvider (slimeknights.tconstruct.tools.data.sprite.TinkerMaterialSpriteProvider)2 TinkerPartSpriteProvider (slimeknights.tconstruct.tools.data.sprite.TinkerPartSpriteProvider)2 GsonBuilder (com.google.gson.GsonBuilder)1 MaterialisBlockStates (com.rcx.materialis.datagen.MaterialisBlockStates)1 MaterialisBlockTags (com.rcx.materialis.datagen.MaterialisBlockTags)1 MaterialisFluidTags (com.rcx.materialis.datagen.MaterialisFluidTags)1 MaterialisItemModels (com.rcx.materialis.datagen.MaterialisItemModels)1 MaterialisItemTags (com.rcx.materialis.datagen.MaterialisItemTags)1 MaterialisLang (com.rcx.materialis.datagen.MaterialisLang)1 MaterialisLootTables (com.rcx.materialis.datagen.MaterialisLootTables)1 MaterialisMaterialTextures (com.rcx.materialis.datagen.MaterialisMaterialTextures)1 MaterialisMaterials (com.rcx.materialis.datagen.MaterialisMaterials)1 MaterialisMaterialStats (com.rcx.materialis.datagen.MaterialisMaterials.MaterialisMaterialStats)1 MaterialisMaterialTraits (com.rcx.materialis.datagen.MaterialisMaterials.MaterialisMaterialTraits)1 MaterialisPartTextures (com.rcx.materialis.datagen.MaterialisPartTextures)1