use of com.mcmoddev.lib.init.Materials in project BaseMetals by MinecraftModDevelopmentMods.
the class VanillaBlocks method registerVanilla.
@SubscribeEvent
public static void registerVanilla(MMDLibRegisterBlocks ev) {
// Vanilla Materials get their Ore and Block always
final MMDMaterial charcoal = Materials.getMaterialByName(MaterialNames.CHARCOAL);
final MMDMaterial gold = Materials.getMaterialByName(MaterialNames.GOLD);
final MMDMaterial iron = Materials.getMaterialByName(MaterialNames.IRON);
final MMDMaterial quartz = Materials.getMaterialByName(MaterialNames.QUARTZ);
if (Materials.hasMaterial(MaterialNames.CHARCOAL)) {
create(Names.BLOCK, charcoal);
}
Arrays.stream(new String[] { MaterialNames.DIAMOND, MaterialNames.EMERALD, MaterialNames.GOLD, MaterialNames.OBSIDIAN }).filter(n -> Options.isMaterialEnabled(n.toString())).filter(Materials::hasMaterial).map(Materials::getMaterialByName).forEach(mat -> {
Arrays.stream(new Names[] { Names.BARS, Names.DOOR, Names.TRAPDOOR, Names.BUTTON, Names.SLAB, Names.DOUBLE_SLAB, Names.LEVER, Names.PRESSURE_PLATE, Names.STAIRS, Names.WALL }).forEach(n -> create(n, mat));
});
if (Materials.hasMaterial(MaterialNames.GOLD) && Options.isMaterialEnabled(MaterialNames.GOLD)) {
create(Names.PLATE, gold);
}
if (Materials.hasMaterial(MaterialNames.IRON) && Options.isMaterialEnabled(MaterialNames.IRON)) {
create(Names.PLATE, iron);
create(Names.BUTTON, iron);
create(Names.SLAB, iron);
create(Names.DOUBLE_SLAB, iron);
create(Names.LEVER, iron);
create(Names.PRESSURE_PLATE, iron);
create(Names.STAIRS, iron);
create(Names.WALL, iron);
}
if (Materials.hasMaterial(MaterialNames.QUARTZ) && Options.isMaterialEnabled(MaterialNames.QUARTZ)) {
create(Names.BARS, quartz);
create(Names.DOOR, quartz);
create(Names.TRAPDOOR, quartz);
create(Names.BUTTON, quartz);
create(Names.LEVER, quartz);
create(Names.PRESSURE_PLATE, quartz);
create(Names.WALL, quartz);
}
}
use of com.mcmoddev.lib.init.Materials in project BaseMetals by MinecraftModDevelopmentMods.
the class BMeEnderIO method init.
/**
*/
@Override
public void init() {
if (!Options.isModEnabled(PLUGIN_MODID)) {
return;
}
final List<String> materials = Arrays.asList(MaterialNames.ADAMANTINE, MaterialNames.ANTIMONY, MaterialNames.AQUARIUM, MaterialNames.BISMUTH, MaterialNames.BRASS, MaterialNames.BRONZE, MaterialNames.COLDIRON, MaterialNames.CUPRONICKEL, MaterialNames.ELECTRUM, MaterialNames.INVAR, MaterialNames.MITHRIL, MaterialNames.PEWTER, MaterialNames.PLATINUM, MaterialNames.STARSTEEL, MaterialNames.STEEL, MaterialNames.TIN, MaterialNames.ZINC);
materials.stream().filter(Materials::hasMaterial).filter(materialName -> !Materials.getMaterialByName(materialName).isEmpty()).forEach(materialName -> addSagMillRecipe(materialName, 3600));
addSagMillRecipe(MaterialNames.COPPER, 2, MaterialNames.GOLD, 1, 3600);
addSagMillRecipe(MaterialNames.LEAD, 2, MaterialNames.SILVER, 1, 3600);
addSagMillRecipe(MaterialNames.NICKEL, 2, MaterialNames.PLATINUM, 1, 3600);
addSagMillRecipe(MaterialNames.SILVER, 2, MaterialNames.LEAD, 1, 3600);
addSagMillRecipe(MaterialNames.IRON, 2, MaterialNames.NICKEL, 1, 3600);
final String COPPER = "Copper";
final String IRON = "Iron";
final String NICKEL = "Nickel";
final String SILVER = "Silver";
final String TIN = "Tin";
final String ZINC = "Zinc";
final List<Pair<Integer, Triple<String, Integer, Object[]>>> alloys = Arrays.asList(Pair.of(3, Triple.of(MaterialNames.AQUARIUM, 20000, new Object[] { Oredicts.INGOT + COPPER, 2, Oredicts.INGOT + ZINC, 1, Oredicts.DUST + "Prismarine", 1 })), Pair.of(3, Triple.of(MaterialNames.BRASS, 2000, new Object[] { Oredicts.INGOT + COPPER, 2, Oredicts.INGOT + ZINC, 1 })), Pair.of(4, Triple.of(MaterialNames.BRONZE, 2000, new Object[] { Oredicts.INGOT + COPPER, 3, Oredicts.INGOT + TIN, 1 })), Pair.of(4, Triple.of(MaterialNames.CUPRONICKEL, 3000, new Object[] { Oredicts.INGOT + COPPER, 3, Oredicts.INGOT + NICKEL, 1 })), Pair.of(3, Triple.of(MaterialNames.INVAR, 3000, new Object[] { Oredicts.INGOT + IRON, 2, Oredicts.INGOT + NICKEL, 1 })), Pair.of(2, Triple.of(MaterialNames.ELECTRUM, 2000, new Object[] { Oredicts.INGOT + "Gold", 1, Oredicts.INGOT + SILVER, 1 })), Pair.of(2, Triple.of(MaterialNames.MITHRIL, 10000, new Object[] { Oredicts.INGOT + SILVER, 2, Oredicts.INGOT + "Coldiron", 1, Oredicts.INGOT + "Mercury", 1 })), Pair.of(3, Triple.of(MaterialNames.PEWTER, 2000, new Object[] { Oredicts.INGOT + TIN, 1, Oredicts.INGOT + COPPER, 1, Oredicts.INGOT + "Lead", 1 })), Pair.of(8, Triple.of(MaterialNames.STEEL, 5000, new Object[] { Oredicts.INGOT + IRON, 8, "itemCoal", 1 })));
alloys.stream().filter(p -> Materials.hasMaterial(p.getRight().getLeft())).forEach(p -> {
final String name = p.getRight().getLeft();
final int count = p.getLeft();
final int cost = p.getRight().getMiddle();
final Object[] recipe = p.getRight().getRight();
final MMDMaterial material = Materials.getMaterialByName(name);
addAlloySmelterAlloy(material, cost, Oredicts.INGOT + material.getCapitalizedName(), count, recipe);
});
}
use of com.mcmoddev.lib.init.Materials 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());
}
Aggregations