use of com.rcx.materialis.datagen.MaterialisMaterialTextures 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));
}
}
Aggregations