Hi,
I wanted to create a mod with IC2 integration but not dependency. I've tried this:
Java
package addedcompat.integration;
import java.util.logging.Level;
import ic2.api.item.Items;import net.minecraft.block.Block;import net.minecraft.item.Item;import net.minecraft.item.ItemStack;import net.minecraft.item.crafting.CraftingManager;import net.minecraftforge.oredict.ShapedOreRecipe;import net.minecraftforge.oredict.ShapelessOreRecipe;import addedcompat.common.AddedCompat;import addedcompat.common.CraftingManagerTable;import addedcompat.common.LogHelper;import cpw.mods.fml.common.Loader;
public class IC2Integration { public static void isIC2Installed() { if(Loader.isModLoaded("IC2")) { try { LogHelper.log(Level.INFO, "IC2 integration initialised"); ItemStack energyCrystal = Items.getItem("energyCrystal"); ItemStack lapotronCrystal = Items.getItem("lapotronCrystal"); ItemStack advancedCircuit = Items.getItem("advancedCircuit"); ItemStack lapiDust = Items.getItem("lapiDust"); ItemStack bronzeIngot = Items.getItem("bronzeIngot");
CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe((energyCrystal), new Object[] { "RRR", "RSR", "RRR", Character.valueOf('R'), Item.redstone, Character.valueOf('S'), new ItemStack(AddedCompat.metaItemCompat,1,0) })); CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe((lapotronCrystal), new Object[] { "LAL", "LRL", "LAL", Character.valueOf('R'), new ItemStack(AddedCompat.metaItemCompat,1,1), Character.valueOf('A'), advancedCircuit, Character.valueOf('L'), lapiDust })); CraftingManagerTable.getInstance().getRecipeList().add(new ShapelessOreRecipe((bronzeIngot), new Object[] { Block.cobblestone, Item.ingotIron })); CraftingManagerTable.getInstance().getRecipeList().add(new ShapelessOreRecipe(new ItemStack(Item.ingotIron), new Object[] { Block.cobblestone, bronzeIngot })); } catch(Exception e) { LogHelper.log(Level.INFO, "IC2 integration not initialised"); e.printStackTrace(System.err); } }else{ } }}
This doesn't seem to work.
Thanks!