Mekanism-tilera-Edition/src/main/java/mekanism/common/integration/OreDictManager.java

512 lines
21 KiB
Java
Raw Normal View History

package mekanism.common.integration;
import ic2.api.recipe.RecipeInputOreDict;
import ic2.api.recipe.Recipes;
2014-01-14 03:43:36 +01:00
import java.util.ArrayList;
2014-01-18 18:08:11 +01:00
import mekanism.api.AdvancedInput;
2014-01-14 03:43:36 +01:00
import mekanism.api.ChanceOutput;
2014-01-16 00:01:12 +01:00
import mekanism.api.gas.GasRegistry;
import mekanism.api.gas.GasStack;
import mekanism.api.infuse.InfuseObject;
import mekanism.api.infuse.InfuseRegistry;
import mekanism.api.infuse.InfusionInput;
import mekanism.common.Mekanism;
import mekanism.common.recipe.RecipeHandler;
2014-01-14 03:43:36 +01:00
import mekanism.common.recipe.RecipeHandler.Recipe;
import mekanism.common.util.MekanismUtils;
2014-01-14 03:43:36 +01:00
import mekanism.common.util.StackUtils;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
2014-01-14 03:43:36 +01:00
import net.minecraft.inventory.Container;
import net.minecraft.inventory.InventoryCrafting;
import net.minecraft.item.ItemStack;
2014-01-14 03:43:36 +01:00
import net.minecraft.item.crafting.CraftingManager;
import net.minecraft.item.crafting.FurnaceRecipes;
import net.minecraftforge.oredict.OreDictionary;
public final class OreDictManager
{
public static void init()
{
2014-01-14 03:43:36 +01:00
addLogRecipes();
for(ItemStack ore : OreDictionary.getOres("plankWood"))
{
if(ore.getHasSubtypes())
{
2014-05-29 20:01:43 +02:00
ItemStack wildStack = new ItemStack(ore.getItem(), 1, OreDictionary.WILDCARD_VALUE);
2014-01-14 03:43:36 +01:00
if(!Recipe.PRECISION_SAWMILL.containsRecipe(wildStack))
{
RecipeHandler.addPrecisionSawmillRecipe(wildStack, new ChanceOutput(new ItemStack(Items.stick, 6), new ItemStack(Mekanism.Sawdust), 0.25));
2014-01-14 03:43:36 +01:00
}
}
else {
RecipeHandler.addPrecisionSawmillRecipe(StackUtils.size(ore, 1), new ChanceOutput(new ItemStack(Items.stick, 6), new ItemStack(Mekanism.Sawdust), 0.25));
2014-01-14 03:43:36 +01:00
}
}
2014-02-04 18:24:39 +01:00
for(ItemStack ore : OreDictionary.getOres("oreNetherSteel"))
{
RecipeHandler.addEnrichmentChamberRecipe(StackUtils.size(ore, 1), new ItemStack(Mekanism.Dust, 4, 5));
}
if(OreDictionary.getOres("itemRubber").size() > 0)
{
for(ItemStack ore : OreDictionary.getOres("woodRubber"))
{
RecipeHandler.addPrecisionSawmillRecipe(MekanismUtils.size(ore, 1), new ChanceOutput(new ItemStack(Blocks.planks, 4), MekanismUtils.size(OreDictionary.getOres("itemRubber").get(0), 1), 1F));
}
}
2014-01-16 00:01:12 +01:00
for(ItemStack ore : OreDictionary.getOres("dustSulfur"))
{
RecipeHandler.addChemicalOxidizerRecipe(MekanismUtils.size(ore, 1), new GasStack(GasRegistry.getGas("sulfurDioxideGas"), 100));
}
for(ItemStack ore : OreDictionary.getOres("dustRefinedObsidian"))
{
RecipeHandler.addOsmiumCompressorRecipe(MekanismUtils.size(ore, 1), new ItemStack(Mekanism.Ingot, 1, 0));
RecipeHandler.addCrusherRecipe(MekanismUtils.size(ore, 1), new ItemStack(Mekanism.DirtyDust, 1, 6));
}
for(ItemStack ore : OreDictionary.getOres("clumpIron"))
{
RecipeHandler.addCrusherRecipe(MekanismUtils.size(ore, 1), new ItemStack(Mekanism.DirtyDust, 1, 0));
}
for(ItemStack ore : OreDictionary.getOres("clumpGold"))
{
RecipeHandler.addCrusherRecipe(MekanismUtils.size(ore, 1), new ItemStack(Mekanism.DirtyDust, 1, 1));
}
for(ItemStack ore : OreDictionary.getOres("clumpOsmium"))
{
RecipeHandler.addCrusherRecipe(MekanismUtils.size(ore, 1), new ItemStack(Mekanism.DirtyDust, 1, 2));
}
for(ItemStack ore : OreDictionary.getOres("clumpCopper"))
{
RecipeHandler.addCrusherRecipe(MekanismUtils.size(ore, 1), new ItemStack(Mekanism.DirtyDust, 1, 3));
}
for(ItemStack ore : OreDictionary.getOres("clumpTin"))
{
RecipeHandler.addCrusherRecipe(MekanismUtils.size(ore, 1), new ItemStack(Mekanism.DirtyDust, 1, 4));
}
for(ItemStack ore : OreDictionary.getOres("clumpSilver"))
{
RecipeHandler.addCrusherRecipe(MekanismUtils.size(ore, 1), new ItemStack(Mekanism.DirtyDust, 1, 5));
}
for(ItemStack ore : OreDictionary.getOres("clumpObsidian"))
{
RecipeHandler.addCrusherRecipe(MekanismUtils.size(ore, 1), new ItemStack(Mekanism.DirtyDust, 1, 6));
}
for(ItemStack ore : OreDictionary.getOres("clumpLead"))
{
RecipeHandler.addCrusherRecipe(MekanismUtils.size(ore, 1), new ItemStack(Mekanism.DirtyDust, 1, 7));
}
for(ItemStack ore : OreDictionary.getOres("shardIron"))
{
RecipeHandler.addPurificationChamberRecipe(MekanismUtils.size(ore, 1), new ItemStack(Mekanism.Clump, 1, 0));
}
for(ItemStack ore : OreDictionary.getOres("shardGold"))
{
RecipeHandler.addPurificationChamberRecipe(MekanismUtils.size(ore, 1), new ItemStack(Mekanism.Clump, 1, 1));
}
for(ItemStack ore : OreDictionary.getOres("shardOsmium"))
{
RecipeHandler.addPurificationChamberRecipe(MekanismUtils.size(ore, 1), new ItemStack(Mekanism.Clump, 1, 2));
}
for(ItemStack ore : OreDictionary.getOres("shardCopper"))
{
RecipeHandler.addPurificationChamberRecipe(MekanismUtils.size(ore, 1), new ItemStack(Mekanism.Clump, 1, 3));
}
for(ItemStack ore : OreDictionary.getOres("shardTin"))
{
RecipeHandler.addPurificationChamberRecipe(MekanismUtils.size(ore, 1), new ItemStack(Mekanism.Clump, 1, 4));
}
for(ItemStack ore : OreDictionary.getOres("shardSilver"))
{
RecipeHandler.addPurificationChamberRecipe(MekanismUtils.size(ore, 1), new ItemStack(Mekanism.Clump, 1, 5));
}
for(ItemStack ore : OreDictionary.getOres("shardObsidian"))
{
RecipeHandler.addPurificationChamberRecipe(MekanismUtils.size(ore, 1), new ItemStack(Mekanism.Clump, 1, 6));
}
for(ItemStack ore : OreDictionary.getOres("shardLead"))
{
RecipeHandler.addPurificationChamberRecipe(MekanismUtils.size(ore, 1), new ItemStack(Mekanism.Clump, 1, 7));
}
2014-02-02 17:05:09 +01:00
for(ItemStack ore : OreDictionary.getOres("crystalIron"))
{
2014-02-02 17:05:09 +01:00
RecipeHandler.addChemicalInjectionChamberRecipe(new AdvancedInput(MekanismUtils.size(ore, 1), GasRegistry.getGas("hydrogenChloride")), new ItemStack(Mekanism.Shard, 1, 0));
}
2014-02-02 17:05:09 +01:00
for(ItemStack ore : OreDictionary.getOres("crystalGold"))
{
2014-02-02 17:05:09 +01:00
RecipeHandler.addChemicalInjectionChamberRecipe(new AdvancedInput(MekanismUtils.size(ore, 1), GasRegistry.getGas("hydrogenChloride")), new ItemStack(Mekanism.Shard, 1, 1));
}
2014-02-02 17:05:09 +01:00
for(ItemStack ore : OreDictionary.getOres("crystalOsmium"))
{
2014-02-02 17:05:09 +01:00
RecipeHandler.addChemicalInjectionChamberRecipe(new AdvancedInput(MekanismUtils.size(ore, 1), GasRegistry.getGas("hydrogenChloride")), new ItemStack(Mekanism.Shard, 1, 2));
}
2014-02-02 17:05:09 +01:00
for(ItemStack ore : OreDictionary.getOres("crystalCopper"))
{
2014-02-02 17:05:09 +01:00
RecipeHandler.addChemicalInjectionChamberRecipe(new AdvancedInput(MekanismUtils.size(ore, 1), GasRegistry.getGas("hydrogenChloride")), new ItemStack(Mekanism.Shard, 1, 3));
}
2014-02-02 17:05:09 +01:00
for(ItemStack ore : OreDictionary.getOres("crystalTin"))
{
2014-02-02 17:05:09 +01:00
RecipeHandler.addChemicalInjectionChamberRecipe(new AdvancedInput(MekanismUtils.size(ore, 1), GasRegistry.getGas("hydrogenChloride")), new ItemStack(Mekanism.Shard, 1, 4));
}
2014-02-02 17:05:09 +01:00
for(ItemStack ore : OreDictionary.getOres("crystalSilver"))
{
2014-02-02 17:05:09 +01:00
RecipeHandler.addChemicalInjectionChamberRecipe(new AdvancedInput(MekanismUtils.size(ore, 1), GasRegistry.getGas("hydrogenChloride")), new ItemStack(Mekanism.Shard, 1, 5));
}
2014-02-02 17:05:09 +01:00
for(ItemStack ore : OreDictionary.getOres("crystalObsidian"))
{
2014-02-02 17:05:09 +01:00
RecipeHandler.addChemicalInjectionChamberRecipe(new AdvancedInput(MekanismUtils.size(ore, 1), GasRegistry.getGas("hydrogenChloride")), new ItemStack(Mekanism.Shard, 1, 6));
}
2014-02-02 17:05:09 +01:00
for(ItemStack ore : OreDictionary.getOres("crystalLead"))
{
2014-02-02 17:05:09 +01:00
RecipeHandler.addChemicalInjectionChamberRecipe(new AdvancedInput(MekanismUtils.size(ore, 1), GasRegistry.getGas("hydrogenChloride")), new ItemStack(Mekanism.Shard, 1, 7));
}
for(ItemStack ore : OreDictionary.getOres("dustDirtyIron"))
{
RecipeHandler.addEnrichmentChamberRecipe(MekanismUtils.size(ore, 1), new ItemStack(Mekanism.Dust, 1, 0));
}
for(ItemStack ore : OreDictionary.getOres("dustDirtyGold"))
{
RecipeHandler.addEnrichmentChamberRecipe(MekanismUtils.size(ore, 1), new ItemStack(Mekanism.Dust, 1, 1));
}
for(ItemStack ore : OreDictionary.getOres("dustDirtyOsmium"))
{
RecipeHandler.addEnrichmentChamberRecipe(MekanismUtils.size(ore, 1), new ItemStack(Mekanism.Dust, 1, 2));
}
for(ItemStack ore : OreDictionary.getOres("dustDirtyCopper"))
{
RecipeHandler.addEnrichmentChamberRecipe(MekanismUtils.size(ore, 1), new ItemStack(Mekanism.Dust, 1, 6));
}
for(ItemStack ore : OreDictionary.getOres("dustDirtyTin"))
{
RecipeHandler.addEnrichmentChamberRecipe(MekanismUtils.size(ore, 1), new ItemStack(Mekanism.Dust, 1, 7));
}
for(ItemStack ore : OreDictionary.getOres("dustDirtySilver"))
{
RecipeHandler.addEnrichmentChamberRecipe(MekanismUtils.size(ore, 1), new ItemStack(Mekanism.Dust, 1, 8));
}
for(ItemStack ore : OreDictionary.getOres("dustDirtyLead"))
{
RecipeHandler.addEnrichmentChamberRecipe(MekanismUtils.size(ore, 1), new ItemStack(Mekanism.Dust, 1, 9));
}
for(ItemStack ore : OreDictionary.getOres("oreCopper"))
{
RecipeHandler.addEnrichmentChamberRecipe(MekanismUtils.size(ore, 1), new ItemStack(Mekanism.Dust, 2, 6));
RecipeHandler.addPurificationChamberRecipe(MekanismUtils.size(ore, 1), new ItemStack(Mekanism.Clump, 3, 3));
RecipeHandler.addChemicalInjectionChamberRecipe(new AdvancedInput(MekanismUtils.size(ore, 1), GasRegistry.getGas("hydrogenChloride")), new ItemStack(Mekanism.Shard, 4, 3));
RecipeHandler.addChemicalDissolutionChamberRecipe(MekanismUtils.size(ore, 1), new GasStack(GasRegistry.getGas("copper"), 1000));
}
for(ItemStack ore : OreDictionary.getOres("oreTin"))
{
RecipeHandler.addEnrichmentChamberRecipe(MekanismUtils.size(ore, 1), new ItemStack(Mekanism.Dust, 2, 7));
RecipeHandler.addPurificationChamberRecipe(MekanismUtils.size(ore, 1), new ItemStack(Mekanism.Clump, 3, 4));
RecipeHandler.addChemicalInjectionChamberRecipe(new AdvancedInput(MekanismUtils.size(ore, 1), GasRegistry.getGas("hydrogenChloride")), new ItemStack(Mekanism.Shard, 4, 4));
RecipeHandler.addChemicalDissolutionChamberRecipe(MekanismUtils.size(ore, 1), new GasStack(GasRegistry.getGas("tin"), 1000));
}
for(ItemStack ore : OreDictionary.getOres("oreOsmium"))
{
RecipeHandler.addEnrichmentChamberRecipe(MekanismUtils.size(ore, 1), new ItemStack(Mekanism.Dust, 2, 2));
RecipeHandler.addPurificationChamberRecipe(MekanismUtils.size(ore, 1), new ItemStack(Mekanism.Clump, 3, 2));
RecipeHandler.addChemicalInjectionChamberRecipe(new AdvancedInput(MekanismUtils.size(ore, 1), GasRegistry.getGas("hydrogenChloride")), new ItemStack(Mekanism.Shard, 4, 2));
RecipeHandler.addChemicalDissolutionChamberRecipe(MekanismUtils.size(ore, 1), new GasStack(GasRegistry.getGas("osmium"), 1000));
}
for(ItemStack ore : OreDictionary.getOres("oreIron"))
{
2014-01-18 08:31:36 +01:00
RecipeHandler.addEnrichmentChamberRecipe(MekanismUtils.size(ore, 1), new ItemStack(Mekanism.Dust, 2, 0));
RecipeHandler.addPurificationChamberRecipe(MekanismUtils.size(ore, 1), new ItemStack(Mekanism.Clump, 3, 0));
RecipeHandler.addChemicalInjectionChamberRecipe(new AdvancedInput(MekanismUtils.size(ore, 1), GasRegistry.getGas("hydrogenChloride")), new ItemStack(Mekanism.Shard, 4, 0));
RecipeHandler.addChemicalDissolutionChamberRecipe(MekanismUtils.size(ore, 1), new GasStack(GasRegistry.getGas("iron"), 1000));
}
for(ItemStack ore : OreDictionary.getOres("oreGold"))
{
2014-01-18 08:31:36 +01:00
RecipeHandler.addEnrichmentChamberRecipe(MekanismUtils.size(ore, 1), new ItemStack(Mekanism.Dust, 2, 1));
RecipeHandler.addPurificationChamberRecipe(MekanismUtils.size(ore, 1), new ItemStack(Mekanism.Clump, 3, 1));
RecipeHandler.addChemicalInjectionChamberRecipe(new AdvancedInput(MekanismUtils.size(ore, 1), GasRegistry.getGas("hydrogenChloride")), new ItemStack(Mekanism.Shard, 4, 1));
RecipeHandler.addChemicalDissolutionChamberRecipe(MekanismUtils.size(ore, 1), new GasStack(GasRegistry.getGas("gold"), 1000));
}
for(ItemStack ore : OreDictionary.getOres("oreSilver"))
{
RecipeHandler.addEnrichmentChamberRecipe(MekanismUtils.size(ore, 1), new ItemStack(Mekanism.Dust, 2, 8));
RecipeHandler.addPurificationChamberRecipe(MekanismUtils.size(ore, 1), new ItemStack(Mekanism.Clump, 3, 5));
RecipeHandler.addChemicalInjectionChamberRecipe(new AdvancedInput(MekanismUtils.size(ore, 1), GasRegistry.getGas("hydrogenChloride")), new ItemStack(Mekanism.Shard, 4, 5));
RecipeHandler.addChemicalDissolutionChamberRecipe(MekanismUtils.size(ore, 1), new GasStack(GasRegistry.getGas("silver"), 1000));
}
for(ItemStack ore : OreDictionary.getOres("oreLead"))
{
RecipeHandler.addEnrichmentChamberRecipe(MekanismUtils.size(ore, 1), new ItemStack(Mekanism.Dust, 2, 9));
RecipeHandler.addPurificationChamberRecipe(MekanismUtils.size(ore, 1), new ItemStack(Mekanism.Clump, 3, 7));
RecipeHandler.addChemicalInjectionChamberRecipe(new AdvancedInput(MekanismUtils.size(ore, 1), GasRegistry.getGas("hydrogenChloride")), new ItemStack(Mekanism.Shard, 4, 7));
RecipeHandler.addChemicalDissolutionChamberRecipe(MekanismUtils.size(ore, 1), new GasStack(GasRegistry.getGas("lead"), 1000));
}
2014-01-18 17:26:24 +01:00
for(ItemStack ore : OreDictionary.getOres("oreNickel"))
{
try {
RecipeHandler.addEnrichmentChamberRecipe(MekanismUtils.size(ore, 1), StackUtils.size(OreDictionary.getOres("dustNickel").get(0), 2));
} catch(Exception e) {}
}
2014-02-16 19:13:35 +01:00
for(ItemStack ore : OreDictionary.getOres("oreYellorite"))
2014-03-07 16:46:43 +01:00
{
try {
RecipeHandler.addEnrichmentChamberRecipe(MekanismUtils.size(ore, 1), StackUtils.size(OreDictionary.getOres("dustYellorium").get(0), 2));
} catch(Exception e) {}
}
2014-01-18 17:26:24 +01:00
for(ItemStack ore : OreDictionary.getOres("ingotCopper"))
{
RecipeHandler.addCrusherRecipe(MekanismUtils.size(ore, 1), new ItemStack(Mekanism.Dust, 1, 6));
}
for(ItemStack ore : OreDictionary.getOres("ingotTin"))
{
RecipeHandler.addCrusherRecipe(MekanismUtils.size(ore, 1), new ItemStack(Mekanism.Dust, 1, 7));
}
for(ItemStack ore : OreDictionary.getOres("ingotLead"))
{
RecipeHandler.addCrusherRecipe(MekanismUtils.size(ore, 1), new ItemStack(Mekanism.Dust, 1, 9));
}
for(ItemStack ore : OreDictionary.getOres("ingotSilver"))
{
RecipeHandler.addCrusherRecipe(MekanismUtils.size(ore, 1), new ItemStack(Mekanism.Dust, 1, 8));
}
for(ItemStack ore : OreDictionary.getOres("ingotRefinedObsidian"))
{
RecipeHandler.addCrusherRecipe(MekanismUtils.size(ore, 1), new ItemStack(Mekanism.Dust, 1, 3));
}
for(ItemStack ore : OreDictionary.getOres("ingotOsmium"))
{
RecipeHandler.addCrusherRecipe(MekanismUtils.size(ore, 1), new ItemStack(Mekanism.Dust, 1, 2));
}
for(ItemStack ore : OreDictionary.getOres("ingotRedstone"))
{
RecipeHandler.addCrusherRecipe(MekanismUtils.size(ore, 1), new ItemStack(Items.redstone));
}
for(ItemStack ore : OreDictionary.getOres("ingotRefinedGlowstone"))
{
2014-05-29 20:01:43 +02:00
RecipeHandler.addCrusherRecipe(MekanismUtils.size(ore, 1), new ItemStack(Items.glowstone_dust));
}
2014-01-18 17:26:24 +01:00
for(ItemStack ore : OreDictionary.getOres("ingotNickel"))
{
try {
RecipeHandler.addCrusherRecipe(MekanismUtils.size(ore, 1), StackUtils.size(OreDictionary.getOres("dustNickel").get(0), 1));
} catch(Exception e) {}
}
try {
RecipeHandler.addCrusherRecipe(new ItemStack(Mekanism.Ingot, 1, 2), MekanismUtils.size(OreDictionary.getOres("dustBronze").get(0), 1));
if(Mekanism.hooks.IC2Loaded)
{
Recipes.macerator.addRecipe(new RecipeInputOreDict("ingotBronze"), null, MekanismUtils.size(OreDictionary.getOres("dustBronze").get(0), 1));
}
} catch(Exception e) {}
try {
2014-05-29 20:01:43 +02:00
FurnaceRecipes.smelting().func_151394_a(new ItemStack(Mekanism.Dust, 8), MekanismUtils.size(OreDictionary.getOres("ingotSilver").get(0), 1), 0.0F);
} catch(Exception e) {}
try {
2014-05-29 20:01:43 +02:00
FurnaceRecipes.smelting().func_151394_a(new ItemStack(Mekanism.Dust, 9), MekanismUtils.size(OreDictionary.getOres("ingotLead").get(0), 1), 0.0F);
} catch(Exception e) {}
try {
RecipeHandler.addCrusherRecipe(new ItemStack(Items.coal), MekanismUtils.size(OreDictionary.getOres("dustCoal").get(0), 1));
} catch(Exception e) {}
try {
RecipeHandler.addCrusherRecipe(new ItemStack(Items.coal, 1, 1), MekanismUtils.size(OreDictionary.getOres("dustCharcoal").get(0), 1));
} catch(Exception e) {}
try {
for(ItemStack ore : OreDictionary.getOres("ingotSilver"))
{
RecipeHandler.addCrusherRecipe(MekanismUtils.size(ore, 1), new ItemStack(Mekanism.Dust, 1, 8));
}
} catch(Exception e) {}
for(ItemStack ore : OreDictionary.getOres("dustIron"))
{
2014-05-29 20:01:43 +02:00
RecipeHandler.addCombinerRecipe(MekanismUtils.size(ore, 8), new ItemStack(Blocks.iron_ore));
}
for(ItemStack ore : OreDictionary.getOres("ingotSteel"))
{
RecipeHandler.addCrusherRecipe(MekanismUtils.size(ore, 1), new ItemStack(Mekanism.Dust, 1, 5));
}
for(ItemStack ore : OreDictionary.getOres("dustGold"))
{
2014-05-29 20:01:43 +02:00
RecipeHandler.addCombinerRecipe(MekanismUtils.size(ore, 8), new ItemStack(Blocks.gold_ore));
}
for(ItemStack ore : OreDictionary.getOres("dustLapisLazuli"))
{
RecipeHandler.addCrusherRecipe(new ItemStack(Items.dye, 1, 4), MekanismUtils.size(ore, 1));
}
for(ItemStack ore : OreDictionary.getOres("dustObsidian"))
{
RecipeHandler.addCombinerRecipe(MekanismUtils.size(ore, 4), new ItemStack(Blocks.obsidian));
RecipeHandler.addMetallurgicInfuserRecipe(InfusionInput.getInfusion(InfuseRegistry.get("DIAMOND"), 10, MekanismUtils.size(ore, 1)), new ItemStack(Mekanism.Dust, 1, 3));
}
for(ItemStack ore : OreDictionary.getOres("dustOsmium"))
{
RecipeHandler.addCombinerRecipe(MekanismUtils.size(ore, 8), new ItemStack(Mekanism.OreBlock, 1, 0));
}
for(ItemStack ore : OreDictionary.getOres("dustDiamond"))
{
InfuseRegistry.registerInfuseObject(ore, new InfuseObject(InfuseRegistry.get("DIAMOND"), 80));
RecipeHandler.addEnrichmentChamberRecipe(MekanismUtils.size(ore, 1), new ItemStack(Items.diamond));
}
for(ItemStack ore : OreDictionary.getOres("dustCopper"))
{
RecipeHandler.addCombinerRecipe(MekanismUtils.size(ore, 8), new ItemStack(Mekanism.OreBlock, 1, 1));
}
for(ItemStack ore : OreDictionary.getOres("ingotCopper"))
{
RecipeHandler.addMetallurgicInfuserRecipe(InfusionInput.getInfusion(InfuseRegistry.get("TIN"), 10, MekanismUtils.size(ore, 1)), new ItemStack(Mekanism.Ingot, 1, 2));
}
for(ItemStack ore : OreDictionary.getOres("dustTin"))
{
RecipeHandler.addCombinerRecipe(MekanismUtils.size(ore, 8), new ItemStack(Mekanism.OreBlock, 1, 2));
InfuseRegistry.registerInfuseObject(ore, new InfuseObject(InfuseRegistry.get("TIN"), 50));
}
try {
for(ItemStack ore : OreDictionary.getOres("dustLead"))
{
RecipeHandler.addCombinerRecipe(MekanismUtils.size(ore, 8), MekanismUtils.size(OreDictionary.getOres("oreLead").get(0), 1));
}
} catch(Exception e) {}
try {
for(ItemStack ore : OreDictionary.getOres("dustSilver"))
{
RecipeHandler.addCombinerRecipe(MekanismUtils.size(ore, 8), MekanismUtils.size(OreDictionary.getOres("oreSilver").get(0), 1));
}
} catch(Exception e) {}
2014-04-06 02:16:09 +02:00
try {
for(ItemStack ore : OreDictionary.getOres("treeSapling"))
{
if(ore.getItemDamage() == 0 || ore.getItemDamage() == OreDictionary.WILDCARD_VALUE)
{
RecipeHandler.addCrusherRecipe(new ItemStack(ore.getItem(), 1, OreDictionary.WILDCARD_VALUE), new ItemStack(Mekanism.BioFuel, 2));
}
}
} catch(Exception e) {}
}
2014-01-14 03:43:36 +01:00
/**
* Handy method for retrieving all log items, finding their corresponding planks, and making recipes with them. Taken from CofhCore.
*/
public static void addLogRecipes()
{
Container tempContainer = new Container() {
public boolean canInteractWith(EntityPlayer player)
{
return false;
}
};
InventoryCrafting tempCrafting = new InventoryCrafting(tempContainer, 3, 3);
ArrayList recipeList = (ArrayList)CraftingManager.getInstance().getRecipeList();
for(int i = 1; i < 9; i++)
{
tempCrafting.setInventorySlotContents(i, null);
}
ArrayList registeredOres = OreDictionary.getOres("logWood");
for(int i = 0; i < registeredOres.size(); i++)
{
ItemStack logEntry = (ItemStack)registeredOres.get(i);
if(logEntry.getItemDamage() == OreDictionary.WILDCARD_VALUE)
{
for(int j = 0; j < 16; j++)
{
2014-05-29 20:01:43 +02:00
ItemStack log = new ItemStack(logEntry.getItem(), 1, j);
2014-01-14 03:43:36 +01:00
tempCrafting.setInventorySlotContents(0, log);
ItemStack resultEntry = MekanismUtils.findMatchingRecipe(tempCrafting, null);
if(resultEntry != null)
{
RecipeHandler.addPrecisionSawmillRecipe(log, new ChanceOutput(StackUtils.size(resultEntry, 6), new ItemStack(Mekanism.Sawdust), 1));
}
}
}
else {
ItemStack log = StackUtils.size(logEntry, 1);
tempCrafting.setInventorySlotContents(0, log);
ItemStack resultEntry = MekanismUtils.findMatchingRecipe(tempCrafting, null);
if(resultEntry != null)
{
RecipeHandler.addPrecisionSawmillRecipe(log, new ChanceOutput(StackUtils.size(resultEntry, 6), new ItemStack(Mekanism.Sawdust), 1));
}
}
}
}
}