Search in sources :

Example 1 with Materials

use of com.mcmoddev.lib.init.Materials 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 Materials

use of com.mcmoddev.lib.init.Materials 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 3 with Materials

use of com.mcmoddev.lib.init.Materials in project BaseMetals by MinecraftModDevelopmentMods.

the class BMeThermalExpansion method regShit.

/**
 * @param event The Event.
 */
@SubscribeEvent
public void regShit(final RegistryEvent.Register<IRecipe> event) {
    final List<String> materials = Arrays.asList(MaterialNames.ADAMANTINE, MaterialNames.ANTIMONY, MaterialNames.AQUARIUM, MaterialNames.BISMUTH, MaterialNames.BRASS, MaterialNames.COLDIRON, MaterialNames.CUPRONICKEL, MaterialNames.PEWTER, MaterialNames.STARSTEEL, MaterialNames.ZINC, MaterialNames.MERCURY, MaterialNames.REDSTONE);
    materials.stream().filter(Materials::hasMaterial).filter(materialName -> !Materials.getMaterialByName(materialName).isEmpty()).forEach(materialName -> {
        addFurnace(materialName);
        addCrucible(materialName);
        addPlatePress(materialName);
        addPressStorage(materialName);
        addPulverizer(materialName);
    });
    final MMDMaterial brass = Materials.getMaterialByName(MaterialNames.BRASS);
    final MMDMaterial copper = Materials.getMaterialByName(MaterialNames.COPPER);
    final MMDMaterial cupronickel = Materials.getMaterialByName(MaterialNames.CUPRONICKEL);
    final MMDMaterial nickel = Materials.getMaterialByName(MaterialNames.NICKEL);
    final MMDMaterial zinc = Materials.getMaterialByName(MaterialNames.ZINC);
    final MMDMaterial tin = Materials.getMaterialByName(MaterialNames.TIN);
    final MMDMaterial bronze = Materials.getMaterialByName(MaterialNames.BRONZE);
    if (hasMaterials(MaterialNames.COPPER, MaterialNames.ZINC, MaterialNames.BRASS) && materialsHaveItems(Arrays.asList(MaterialNames.COPPER, MaterialNames.ZINC, MaterialNames.BRASS), Names.INGOT.toString())) {
        ThermalExpansionHelper.addSmelterRecipe(4000, copper.getItemStack(Names.INGOT, 2), zinc.getItemStack(Names.INGOT, 1), brass.getItemStack(Names.INGOT, 3));
    }
    if (hasMaterials(MaterialNames.COPPER, MaterialNames.NICKEL, MaterialNames.CUPRONICKEL) && materialsHaveItems(Arrays.asList(MaterialNames.COPPER, MaterialNames.NICKEL, MaterialNames.CUPRONICKEL), Names.INGOT.toString())) {
        ThermalExpansionHelper.addSmelterRecipe(4000, copper.getItemStack(Names.INGOT, 3), nickel.getItemStack(Names.INGOT, 1), cupronickel.getItemStack(Names.INGOT, 4));
    }
    if (hasMaterials(MaterialNames.COPPER, MaterialNames.TIN, MaterialNames.BRONZE) && materialsHaveItems(Arrays.asList(MaterialNames.COPPER, MaterialNames.TIN, MaterialNames.BRONZE), Names.INGOT.toString())) {
        ThermalExpansionHelper.addSmelterRecipe(4000, copper.getItemStack(Names.INGOT, 3), tin.getItemStack(Names.INGOT, 1), bronze.getItemStack(Names.INGOT, 3));
    }
}
Also used : Arrays(java.util.Arrays) IRecipe(net.minecraft.item.crafting.IRecipe) Options(com.mcmoddev.lib.util.Config.Options) Materials(com.mcmoddev.lib.init.Materials) ThermalExpansion(com.mcmoddev.lib.integration.plugins.ThermalExpansion) MMDMaterial(com.mcmoddev.lib.material.MMDMaterial) ThermalExpansionHelper(cofh.api.util.ThermalExpansionHelper) 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) Materials(com.mcmoddev.lib.init.Materials) MMDMaterial(com.mcmoddev.lib.material.MMDMaterial) SubscribeEvent(net.minecraftforge.fml.common.eventhandler.SubscribeEvent)

Example 4 with Materials

use of com.mcmoddev.lib.init.Materials in project BaseMetals by MinecraftModDevelopmentMods.

the class BMeIC2 method mainInteraction.

/**
 * @param event The Event.
 */
@SubscribeEvent
public void mainInteraction(final RegistryEvent.Register<IRecipe> event) {
    materials.stream().filter(Materials::hasMaterial).filter(materialName -> !Materials.getMaterialByName(materialName).isEmpty()).forEach(materialName -> {
        this.registerVanillaRecipes(materialName);
        this.addMaceratorRecipes(materialName);
        this.addOreWashingPlantRecipes(materialName);
        this.addThermalCentrifugeRecipes(materialName);
        this.addMetalFormerRecipes(materialName);
        this.addCompressorRecipes(materialName);
    });
    if (Materials.hasMaterial(MaterialNames.DIAMOND)) {
        final MMDMaterial diamond = Materials.getMaterialByName(MaterialNames.DIAMOND);
        final String oreDictName = diamond.getCapitalizedName();
        if (diamond.hasItem(Names.POWDER)) {
            this.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)) {
            this.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) 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) 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) IntegrationInitEvent(com.mcmoddev.lib.integration.IntegrationInitEvent) IC2(com.mcmoddev.lib.integration.plugins.IC2) Materials(com.mcmoddev.lib.init.Materials) MMDMaterial(com.mcmoddev.lib.material.MMDMaterial) SubscribeEvent(net.minecraftforge.fml.common.eventhandler.SubscribeEvent)

Example 5 with Materials

use of com.mcmoddev.lib.init.Materials in project BaseMetals by MinecraftModDevelopmentMods.

the class Items method registerItems.

/**
 */
@SubscribeEvent
public static void registerItems(MMDLibRegisterItems ev) {
    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);
    // 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);
    });
    materials.stream().filter(Materials::hasMaterial).map(Materials::getMaterialByName).forEach(com.mcmoddev.basemetals.init.Items::setBurnTimes);
    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();
    MinecraftForge.EVENT_BUS.register(Items.class);
}
Also used : MMDLibRegisterItems(com.mcmoddev.lib.events.MMDLibRegisterItems) Arrays(java.util.Arrays) ItemGroups(com.mcmoddev.lib.init.ItemGroups) Materials(com.mcmoddev.lib.init.Materials) Item(net.minecraft.item.Item) Oredicts(com.mcmoddev.lib.util.Oredicts) 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) IMMDBurnableObject(com.mcmoddev.lib.material.IMMDBurnableObject) ItemStack(net.minecraft.item.ItemStack) List(java.util.List) MinecraftForge(net.minecraftforge.common.MinecraftForge) BaseMetals(com.mcmoddev.basemetals.BaseMetals) ImmutableList(com.google.common.collect.ImmutableList) SubscribeEvent(net.minecraftforge.fml.common.eventhandler.SubscribeEvent) RegistryEvent(net.minecraftforge.event.RegistryEvent) Mod(net.minecraftforge.fml.common.Mod) Nonnull(javax.annotation.Nonnull) Materials(com.mcmoddev.lib.init.Materials) MMDMaterial(com.mcmoddev.lib.material.MMDMaterial) MMDLibRegisterItems(com.mcmoddev.lib.events.MMDLibRegisterItems) SubscribeEvent(net.minecraftforge.fml.common.eventhandler.SubscribeEvent)

Aggregations

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