Search in sources :

Example 1 with MMDMaterial

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

the class IC2 method mainInteraction.

/**
 * @param event
 */
@SubscribeEvent
public void mainInteraction(final RegistryEvent.Register<IRecipe> event) {
    final List<String> materials = Arrays.asList(MaterialNames.ADAMANTINE, MaterialNames.ANTIMONY, MaterialNames.BISMUTH, MaterialNames.COLDIRON, MaterialNames.PLATINUM, MaterialNames.NICKEL, MaterialNames.STARSTEEL, MaterialNames.ZINC);
    materials.stream().filter(Materials::hasMaterial).filter(materialName -> !Materials.getMaterialByName(materialName).isEmpty()).forEach(materialName -> {
        registerVanillaRecipes(materialName);
        addMaceratorRecipes(materialName);
        addOreWashingPlantRecipes(materialName);
        addThermalCentrifugeRecipes(materialName);
        addMetalFormerRecipes(materialName);
        addCompressorRecipes(materialName);
    });
    if (Materials.hasMaterial(MaterialNames.DIAMOND)) {
        final MMDMaterial diamond = Materials.getMaterialByName(MaterialNames.DIAMOND);
        final String oreDictName = diamond.getCapitalizedName();
        if (diamond.hasItem(Names.POWDER)) {
            addMaceratorRecipe(Oredicts.ORE + oreDictName, diamond.getItemStack(Names.POWDER, 2));
        }
    }
    if (Materials.hasMaterial(MaterialNames.EMERALD)) {
        final MMDMaterial emerald = Materials.getMaterialByName(MaterialNames.EMERALD);
        final String oreDictName = emerald.getCapitalizedName();
        if (emerald.hasItem(Names.POWDER)) {
            addMaceratorRecipe(Oredicts.ORE + oreDictName, emerald.getItemStack(Names.POWDER, 2));
        }
    }
    MinecraftForge.EVENT_BUS.register(this);
}
Also used : Arrays(java.util.Arrays) IRecipe(net.minecraft.item.crafting.IRecipe) Materials(com.mcmoddev.lib.init.Materials) Oredicts(com.mcmoddev.lib.util.Oredicts) MMDMaterial(com.mcmoddev.lib.material.MMDMaterial) MaterialNames(com.mcmoddev.basemetals.data.MaterialNames) Names(com.mcmoddev.lib.data.Names) IIntegration(com.mcmoddev.lib.integration.IIntegration) List(java.util.List) MMDPlugin(com.mcmoddev.lib.integration.MMDPlugin) MinecraftForge(net.minecraftforge.common.MinecraftForge) BaseMetals(com.mcmoddev.basemetals.BaseMetals) SubscribeEvent(net.minecraftforge.fml.common.eventhandler.SubscribeEvent) RegistryEvent(net.minecraftforge.event.RegistryEvent) Options(com.mcmoddev.lib.util.ConfigBase.Options) Materials(com.mcmoddev.lib.init.Materials) MMDMaterial(com.mcmoddev.lib.material.MMDMaterial) SubscribeEvent(net.minecraftforge.fml.common.eventhandler.SubscribeEvent)

Example 2 with MMDMaterial

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

the class TinkersConstruct method registerMelting.

private void registerMelting() {
    if (Materials.hasMaterial(MaterialNames.COAL)) {
        registry.registerMelting(net.minecraft.init.Items.COAL, FluidRegistry.getFluidStack(MaterialNames.COAL, 144));
    }
    if (Materials.hasMaterial(MaterialNames.MERCURY)) {
        final MMDMaterial mercury = Materials.getMaterialByName(MaterialNames.MERCURY);
        registry.registerMelting(mercury.getItem(Names.INGOT), FluidRegistry.getFluidStack(mercury.getName(), 144));
    }
    if (Materials.hasMaterial(MaterialNames.PRISMARINE)) {
        final MMDMaterial prismarine = Materials.getMaterialByName(MaterialNames.PRISMARINE);
        registry.registerMelting(net.minecraft.init.Items.PRISMARINE_SHARD, FluidRegistry.getFluidStack(prismarine.getName(), 666));
    }
}
Also used : MMDMaterial(com.mcmoddev.lib.material.MMDMaterial)

Example 3 with MMDMaterial

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

the class Blocks method init.

/**
 */
public static void init() {
    registerVanilla();
    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));
}
Also used : MMDMaterial(com.mcmoddev.lib.material.MMDMaterial) BlockHumanDetector(com.mcmoddev.lib.block.BlockHumanDetector)

Example 4 with MMDMaterial

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

the class Items method init.

/**
 */
public static void init() {
    Materials.getMaterialByName(MaterialNames.CHARCOAL).addNewItemFromItemStack(Names.INGOT, new ItemStack(net.minecraft.init.Items.COAL, 1, 1));
    Materials.getMaterialByName(MaterialNames.COAL).addNewItemFromItemStack(Names.INGOT, new ItemStack(net.minecraft.init.Items.COAL, 1, 0));
    addDiamondBits();
    addGoldBits();
    addIronBits();
    addStoneBits();
    addWoodBits();
    Materials.getMaterialByName(MaterialNames.EMERALD).addNewItem(Names.INGOT, net.minecraft.init.Items.EMERALD);
    Materials.getMaterialByName(MaterialNames.QUARTZ).addNewItem(Names.INGOT, net.minecraft.init.Items.QUARTZ);
    Materials.getMaterialByName(MaterialNames.REDSTONE).addNewItem(Names.POWDER, net.minecraft.init.Items.REDSTONE);
    Materials.getMaterialByName(MaterialNames.LAPIS).addNewItemFromItemStack(Names.INGOT, new ItemStack(net.minecraft.init.Items.DYE, 1, 4));
    doSpecialMats();
    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.EMERALD, MaterialNames.ELECTRUM, MaterialNames.INVAR, MaterialNames.LEAD, MaterialNames.OBSIDIAN, MaterialNames.MITHRIL, MaterialNames.NICKEL, MaterialNames.PEWTER, MaterialNames.PLATINUM, MaterialNames.QUARTZ, MaterialNames.SILVER, MaterialNames.STARSTEEL, MaterialNames.STEEL, MaterialNames.TIN, MaterialNames.ZINC);
    // create and register modded stuffs
    final List<String> materialsModSupport = Arrays.asList(MaterialNames.ADAMANTINE, MaterialNames.ANTIMONY, MaterialNames.BISMUTH, MaterialNames.COLDIRON, MaterialNames.PLATINUM, MaterialNames.NICKEL, MaterialNames.STARSTEEL, MaterialNames.ZINC);
    materials.stream().filter(Materials::hasMaterial).filter(materialName -> !Materials.getMaterialByName(materialName).isEmpty()).forEach(materialName -> {
        final MMDMaterial material = Materials.getMaterialByName(materialName);
        create(Names.BLEND, material);
        create(Names.INGOT, material);
        create(Names.NUGGET, material);
        create(Names.POWDER, material);
        create(Names.SMALLBLEND, material);
        create(Names.SMALLPOWDER, material);
        create(Names.ARROW, material);
        create(Names.AXE, material);
        create(Names.BOLT, material);
        create(Names.BOOTS, material);
        create(Names.BOW, material);
        create(Names.CHESTPLATE, material);
        create(Names.CRACKHAMMER, material);
        create(Names.CROSSBOW, material);
        create(Names.DOOR, material);
        create(Names.FISHING_ROD, material);
        create(Names.HELMET, material);
        create(Names.HOE, material);
        create(Names.HORSE_ARMOR, material);
        create(Names.LEGGINGS, material);
        create(Names.PICKAXE, material);
        create(Names.SHEARS, material);
        create(Names.SHIELD, material);
        create(Names.SHOVEL, material);
        create(Names.SCYTHE, material);
        create(Names.SLAB, material);
        create(Names.SWORD, material);
        create(Names.ROD, material);
        create(Names.GEAR, material);
    });
    materialsModSupport.stream().filter(Materials::hasMaterial).filter(materialName -> !Materials.getMaterialByName(materialName).isEmpty()).forEach(materialName -> {
        final MMDMaterial material = Materials.getMaterialByName(materialName);
        create(Names.CASING, material);
        create(Names.DENSE_PLATE, material);
        if (material.hasOre()) {
            create(Names.CRUSHED, material);
            create(Names.CRUSHED_PURIFIED, material);
            createMekCrystal(material, ItemGroups.getTab(SharedStrings.TAB_ITEMS));
            create(Names.SHARD, material);
            create(Names.CLUMP, material);
            create(Names.POWDER_DIRTY, material);
            create(Names.CRYSTAL, material);
        }
    });
    if (Materials.hasMaterial(MaterialNames.MERCURY)) {
        final MMDMaterial mercury = Materials.getMaterialByName(MaterialNames.MERCURY);
        create(Names.INGOT, mercury);
        create(Names.NUGGET, mercury);
        create(Names.POWDER, mercury);
        create(Names.SMALLPOWDER, mercury);
    }
    Arrays.asList(MaterialNames.STONE, MaterialNames.STEEL, MaterialNames.ADAMANTINE).stream().filter(Materials::hasMaterial).forEach(materialName -> create(Names.ANVIL, Materials.getMaterialByName(materialName)));
    addToMetList();
}
Also used : Arrays(java.util.Arrays) Materials(com.mcmoddev.lib.init.Materials) Item(net.minecraft.item.Item) Oredicts(com.mcmoddev.lib.util.Oredicts) ItemMMDSmallPowder(com.mcmoddev.lib.item.ItemMMDSmallPowder) MMDMaterial(com.mcmoddev.lib.material.MMDMaterial) MaterialNames(com.mcmoddev.basemetals.data.MaterialNames) SharedStrings(com.mcmoddev.lib.data.SharedStrings) IForgeRegistry(net.minecraftforge.registries.IForgeRegistry) Names(com.mcmoddev.lib.data.Names) ItemStack(net.minecraft.item.ItemStack) List(java.util.List) BaseMetals(com.mcmoddev.basemetals.BaseMetals) ImmutableList(com.google.common.collect.ImmutableList) ItemMMDBlock(com.mcmoddev.lib.item.ItemMMDBlock) SubscribeEvent(net.minecraftforge.fml.common.eventhandler.SubscribeEvent) RegistryEvent(net.minecraftforge.event.RegistryEvent) ItemMMDPowder(com.mcmoddev.lib.item.ItemMMDPowder) Nonnull(javax.annotation.Nonnull) ItemMMDNugget(com.mcmoddev.lib.item.ItemMMDNugget) Materials(com.mcmoddev.lib.init.Materials) MMDMaterial(com.mcmoddev.lib.material.MMDMaterial) ItemStack(net.minecraft.item.ItemStack)

Example 5 with MMDMaterial

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

the class Items method addIronBits.

private static void addIronBits() {
    final MMDMaterial iron = Materials.getMaterialByName(MaterialNames.IRON);
    iron.addNewItem(Names.AXE, net.minecraft.init.Items.IRON_AXE);
    iron.addNewItem(Names.DOOR, net.minecraft.init.Items.IRON_DOOR);
    iron.addNewItem(Names.HOE, net.minecraft.init.Items.IRON_HOE);
    iron.addNewItem(Names.HORSE_ARMOR, net.minecraft.init.Items.IRON_HORSE_ARMOR);
    iron.addNewItem(Names.PICKAXE, net.minecraft.init.Items.IRON_PICKAXE);
    iron.addNewItem(Names.SHOVEL, net.minecraft.init.Items.IRON_SHOVEL);
    iron.addNewItem(Names.SWORD, net.minecraft.init.Items.IRON_SWORD);
    iron.addNewItem(Names.BOOTS, net.minecraft.init.Items.IRON_BOOTS);
    iron.addNewItem(Names.CHESTPLATE, net.minecraft.init.Items.IRON_CHESTPLATE);
    iron.addNewItem(Names.HELMET, net.minecraft.init.Items.IRON_HELMET);
    iron.addNewItem(Names.LEGGINGS, net.minecraft.init.Items.IRON_LEGGINGS);
    iron.addNewItem(Names.INGOT, net.minecraft.init.Items.IRON_INGOT);
    iron.addNewItem(Names.NUGGET, net.minecraft.init.Items.IRON_NUGGET);
    iron.addNewItem(Names.SHEARS, net.minecraft.init.Items.SHEARS);
    if (Materials.hasMaterial(MaterialNames.IRON)) {
        create(Names.BLEND, iron);
        create(Names.INGOT, iron);
        create(Names.NUGGET, iron);
        create(Names.POWDER, iron);
        create(Names.SMALLBLEND, iron);
        create(Names.SMALLPOWDER, iron);
        create(Names.ARROW, iron);
        create(Names.AXE, iron);
        create(Names.BOLT, iron);
        create(Names.BOOTS, iron);
        create(Names.BOW, iron);
        create(Names.CHESTPLATE, iron);
        create(Names.CRACKHAMMER, iron);
        create(Names.CROSSBOW, iron);
        create(Names.FISHING_ROD, iron);
        create(Names.HELMET, iron);
        create(Names.HOE, iron);
        create(Names.HORSE_ARMOR, iron);
        create(Names.LEGGINGS, iron);
        create(Names.PICKAXE, iron);
        create(Names.SHEARS, iron);
        create(Names.SHIELD, iron);
        create(Names.SHOVEL, iron);
        create(Names.SLAB, iron);
        create(Names.SWORD, iron);
        create(Names.ROD, iron);
        create(Names.GEAR, iron);
        create(Names.SCYTHE, iron);
    }
}
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