use of slimeknights.tconstruct.tools.data.sprite.TinkerMaterialSpriteProvider 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));
}
}
use of slimeknights.tconstruct.tools.data.sprite.TinkerMaterialSpriteProvider 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));
}
}
Aggregations