Search in sources :

Example 1 with IntegrationPreInitEvent

use of com.mcmoddev.lib.integration.IntegrationPreInitEvent in project BaseMetals by MinecraftModDevelopmentMods.

the class BMeThaumcraft method preInit.

@SubscribeEvent
public static void preInit(IntegrationPreInitEvent ev) {
    List<String> materials = Arrays.asList(MaterialNames.COPPER, MaterialNames.SILVER, MaterialNames.DIAMOND, MaterialNames.EMERALD, MaterialNames.STEEL, MaterialNames.BRASS, MaterialNames.BRONZE, MaterialNames.TIN, MaterialNames.MITHRIL, MaterialNames.AQUARIUM);
    Materials.getAllMaterials().stream().filter(mat -> !mat.isVanilla()).filter(mat -> !mat.isEmpty()).forEach(mat -> {
        String mn = mat.getName();
        TCMaterial tcm = Thaumcraft.createWithAspects(mat);
        tcMaterials.put(mn, tcm);
    });
    Materials.getAllMaterials().stream().filter(mat -> mat.isVanilla()).filter(mat -> !mat.isEmpty()).filter(mat -> mat.getType() == MMDMaterialType.MaterialType.MINERAL || mat.getType() == MMDMaterialType.MaterialType.ROCK).forEach(mat -> {
        String mn = mat.getName();
        TCMaterial tcm = Thaumcraft.createVanillaIngotWithAspects(mat);
        tcMaterials.put(mn, tcm);
    });
    materials.stream().filter(Materials::hasMaterial).forEach(BMeThaumcraft::makeSpecialMaterial);
    tcMaterials.entrySet().stream().map(ent -> ent.getValue()).forEach(tc -> tc.update());
}
Also used : Arrays(java.util.Arrays) Materials(com.mcmoddev.lib.init.Materials) HashMap(java.util.HashMap) TCMaterial(com.mcmoddev.lib.integration.plugins.thaumcraft.TCMaterial) MMDMaterial(com.mcmoddev.lib.material.MMDMaterial) TCSyncEvent(com.mcmoddev.lib.integration.plugins.thaumcraft.TCSyncEvent) MaterialNames(com.mcmoddev.basemetals.data.MaterialNames) Config(com.mcmoddev.lib.util.Config) IIntegration(com.mcmoddev.lib.integration.IIntegration) MMDMaterialType(com.mcmoddev.lib.material.MMDMaterialType) IntegrationPreInitEvent(com.mcmoddev.lib.integration.IntegrationPreInitEvent) List(java.util.List) MaterialStats(com.mcmoddev.lib.data.MaterialStats) MMDPlugin(com.mcmoddev.lib.integration.MMDPlugin) MinecraftForge(net.minecraftforge.common.MinecraftForge) BaseMetals(com.mcmoddev.basemetals.BaseMetals) Map(java.util.Map) Thaumcraft(com.mcmoddev.lib.integration.plugins.Thaumcraft) SubscribeEvent(net.minecraftforge.fml.common.eventhandler.SubscribeEvent) Aspect(thaumcraft.api.aspects.Aspect) TCMaterial(com.mcmoddev.lib.integration.plugins.thaumcraft.TCMaterial) SubscribeEvent(net.minecraftforge.fml.common.eventhandler.SubscribeEvent)

Aggregations

BaseMetals (com.mcmoddev.basemetals.BaseMetals)1 MaterialNames (com.mcmoddev.basemetals.data.MaterialNames)1 MaterialStats (com.mcmoddev.lib.data.MaterialStats)1 Materials (com.mcmoddev.lib.init.Materials)1 IIntegration (com.mcmoddev.lib.integration.IIntegration)1 IntegrationPreInitEvent (com.mcmoddev.lib.integration.IntegrationPreInitEvent)1 MMDPlugin (com.mcmoddev.lib.integration.MMDPlugin)1 Thaumcraft (com.mcmoddev.lib.integration.plugins.Thaumcraft)1 TCMaterial (com.mcmoddev.lib.integration.plugins.thaumcraft.TCMaterial)1 TCSyncEvent (com.mcmoddev.lib.integration.plugins.thaumcraft.TCSyncEvent)1 MMDMaterial (com.mcmoddev.lib.material.MMDMaterial)1 MMDMaterialType (com.mcmoddev.lib.material.MMDMaterialType)1 Config (com.mcmoddev.lib.util.Config)1 Arrays (java.util.Arrays)1 HashMap (java.util.HashMap)1 List (java.util.List)1 Map (java.util.Map)1 MinecraftForge (net.minecraftforge.common.MinecraftForge)1 SubscribeEvent (net.minecraftforge.fml.common.eventhandler.SubscribeEvent)1 Aspect (thaumcraft.api.aspects.Aspect)1