Search in sources :

Example 41 with MMDMaterial

use of com.mcmoddev.lib.material.MMDMaterial in project BaseMetals by MinecraftModDevelopmentMods.

the class AquariumProperty method hasEffect.

@Override
public boolean hasEffect(ItemStack stack, EntityPlayer player) {
    MMDMaterial mat = Materials.getMaterialByName(MaterialNames.AQUARIUM);
    boolean rv = (stackIsArmorMaterial(stack, mat) && ((stack.getItem() instanceof IMMDObject) && (((IMMDObject) stack.getItem()).getMMDMaterial() == mat))) && (countArmorPieces(Materials.getMaterialByName(MaterialNames.AQUARIUM), player) > 0);
    return rv;
}
Also used : IMMDObject(com.mcmoddev.lib.material.IMMDObject) MMDMaterial(com.mcmoddev.lib.material.MMDMaterial)

Example 42 with MMDMaterial

use of com.mcmoddev.lib.material.MMDMaterial in project BaseMetals by MinecraftModDevelopmentMods.

the class Blocks method createMercury.

private static void createMercury() {
    if (Materials.hasMaterial(MaterialNames.MERCURY)) {
        final MMDMaterial mercury = Materials.getMaterialByName(MaterialNames.MERCURY);
        create(Names.ORE, mercury);
        if (mercury.hasBlock(Names.ORE)) {
            mercury.getBlock(Names.ORE).setHardness(3.0f).setResistance(5.0f);
        }
    }
}
Also used : MMDMaterial(com.mcmoddev.lib.material.MMDMaterial)

Example 43 with MMDMaterial

use of com.mcmoddev.lib.material.MMDMaterial in project BaseMetals by MinecraftModDevelopmentMods.

the class Blocks method init.

/**
 */
@SubscribeEvent
public static void init(final MMDLibRegisterBlocks event) {
    final List<String> materials = Arrays.asList(MaterialNames.ADAMANTINE, MaterialNames.ANTIMONY, MaterialNames.AQUARIUM, MaterialNames.BISMUTH, MaterialNames.BRASS, MaterialNames.BRONZE, MaterialNames.COLDIRON, MaterialNames.COPPER, MaterialNames.CUPRONICKEL, MaterialNames.ELECTRUM, MaterialNames.INVAR, MaterialNames.LEAD, MaterialNames.MITHRIL, MaterialNames.NICKEL, MaterialNames.PEWTER, MaterialNames.PLATINUM, MaterialNames.SILVER, MaterialNames.STARSTEEL, MaterialNames.STEEL, MaterialNames.TIN, MaterialNames.ZINC);
    materials.stream().filter(Materials::hasMaterial).forEach(materialName -> {
        final MMDMaterial material = Materials.getMaterialByName(materialName);
        create(Names.BLOCK, material);
        create(Names.PLATE, material);
        create(Names.ORE, material);
        create(Names.BARS, material);
        create(Names.DOOR, material);
        create(Names.TRAPDOOR, material);
        create(Names.BUTTON, material);
        create(Names.SLAB, material);
        create(Names.DOUBLE_SLAB, material);
        create(Names.LEVER, material);
        create(Names.PRESSURE_PLATE, material);
        create(Names.STAIRS, material);
        create(Names.WALL, material);
    });
    createMercury();
    createAnvils();
    addBlock(new BlockHumanDetector(), "human_detector", ItemGroups.getTab(SharedStrings.TAB_BLOCKS));
    MinecraftForge.EVENT_BUS.register(Blocks.class);
}
Also used : MMDMaterial(com.mcmoddev.lib.material.MMDMaterial) BlockHumanDetector(com.mcmoddev.lib.block.BlockHumanDetector) SubscribeEvent(net.minecraftforge.fml.common.eventhandler.SubscribeEvent)

Example 44 with MMDMaterial

use of com.mcmoddev.lib.material.MMDMaterial 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);
    });
}
Also used : Arrays(java.util.Arrays) Options(com.mcmoddev.lib.util.Config.Options) Materials(com.mcmoddev.lib.init.Materials) Oredicts(com.mcmoddev.lib.util.Oredicts) MMDMaterial(com.mcmoddev.lib.material.MMDMaterial) MaterialNames(com.mcmoddev.basemetals.data.MaterialNames) IIntegration(com.mcmoddev.lib.integration.IIntegration) List(java.util.List) MMDPlugin(com.mcmoddev.lib.integration.MMDPlugin) BaseMetals(com.mcmoddev.basemetals.BaseMetals) Pair(org.apache.commons.lang3.tuple.Pair) Triple(org.apache.commons.lang3.tuple.Triple) EnderIO(com.mcmoddev.lib.integration.plugins.EnderIO) Materials(com.mcmoddev.lib.init.Materials) MMDMaterial(com.mcmoddev.lib.material.MMDMaterial) Pair(org.apache.commons.lang3.tuple.Pair)

Example 45 with MMDMaterial

use of com.mcmoddev.lib.material.MMDMaterial in project BaseMetals by MinecraftModDevelopmentMods.

the class Recipes method initModSpecificOredicts.

private static void initModSpecificOredicts() {
    if (Materials.hasMaterial(MaterialNames.ADAMANTINE)) {
        final MMDMaterial adamantine = Materials.getMaterialByName(MaterialNames.ADAMANTINE);
        addAdditionalOredicts(adamantine, "Adamantite");
        addAdditionalOredicts(adamantine, "Adamantium");
        addAdditionalOredicts(adamantine, "Adamant");
    }
    if (Materials.hasMaterial(MaterialNames.MERCURY)) {
        final MMDMaterial mercury = Materials.getMaterialByName(MaterialNames.MERCURY);
        addAdditionalOredicts(mercury, "Quicksilver");
    }
    if (Materials.hasMaterial(MaterialNames.STEEL)) {
        final MMDMaterial steel = Materials.getMaterialByName(MaterialNames.STEEL);
        if (steel.hasItem(Names.GEAR)) {
            OreDictionary.registerOre(Oredicts.SPROCKET, steel.getItemStack(Names.GEAR));
        }
    }
}
Also used : MMDMaterial(com.mcmoddev.lib.material.MMDMaterial)

Aggregations

MMDMaterial (com.mcmoddev.lib.material.MMDMaterial)45 List (java.util.List)9 SubscribeEvent (net.minecraftforge.fml.common.eventhandler.SubscribeEvent)9 BaseMetals (com.mcmoddev.basemetals.BaseMetals)8 Arrays (java.util.Arrays)8 MaterialNames (com.mcmoddev.basemetals.data.MaterialNames)7 Names (com.mcmoddev.lib.data.Names)7 Materials (com.mcmoddev.lib.init.Materials)7 ItemStack (net.minecraft.item.ItemStack)6 RegistryEvent (net.minecraftforge.event.RegistryEvent)6 IIntegration (com.mcmoddev.lib.integration.IIntegration)5 MMDPlugin (com.mcmoddev.lib.integration.MMDPlugin)5 IMMDObject (com.mcmoddev.lib.material.IMMDObject)5 Oredicts (com.mcmoddev.lib.util.Oredicts)5 MinecraftForge (net.minecraftforge.common.MinecraftForge)5 ImmutableList (com.google.common.collect.ImmutableList)4 Options (com.mcmoddev.lib.util.Config.Options)4 Item (net.minecraft.item.Item)4 IRecipe (net.minecraft.item.crafting.IRecipe)4 ThermalExpansionHelper (cofh.api.util.ThermalExpansionHelper)2