Search in sources :

Example 1 with MaterialisItemModels

use of com.rcx.materialis.datagen.MaterialisItemModels 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)

Aggregations

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 MaterialisRecipes (com.rcx.materialis.datagen.MaterialisRecipes)1 MaterialisRenderInfo (com.rcx.materialis.datagen.MaterialisRenderInfo)1 MaterialisToolDefinitions (com.rcx.materialis.datagen.MaterialisToolDefinitions)1 MaterialisToolSlotLayouts (com.rcx.materialis.datagen.MaterialisToolSlotLayouts)1 ItemCameraTransforms (net.minecraft.client.renderer.model.ItemCameraTransforms)1 ItemTransformVec3f (net.minecraft.client.renderer.model.ItemTransformVec3f)1 Variant (net.minecraft.client.renderer.model.Variant)1