package techreborn.compat.ic2;

import ic2.api.item.IC2Items;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
import net.minecraftforge.fml.common.event.FMLServerStartingEvent;
import reborncore.common.util.CraftingHelper;
import techreborn.compat.ICompatModule;
import techreborn.init.ModBlocks;

/**
 * Created by Mark on 06/06/2016.
 */
public class RecipesIC2 implements ICompatModule {
    @Override
    public void preInit(FMLPreInitializationEvent event) {

    }

    @Override
    public void init(FMLInitializationEvent event) {
        CraftingHelper.addShapelessRecipe(new ItemStack(ModBlocks.machineframe, 0, 1), IC2Items.getItem("resource","machine"));
        CraftingHelper.addShapelessRecipe( IC2Items.getItem("resource","machine"), new ItemStack(ModBlocks.machineframe, 0, 1));
    }

    @Override
    public void postInit(FMLPostInitializationEvent event) {

    }

    @Override
    public void serverStarting(FMLServerStartingEvent event) {

    }
}

@@ -488,16 +488,68 @@
 locks;%0A%0A
+import java.util.ArrayList;%0Aimport java.util.List;%0A%0A
 /**%0A * C
@@ -633,16 +633,85 @@
 odule %7B%0A
+%0A    List%3CRecipeDuplicate%3E recipeDuplicateList = new ArrayList%3C%3E();%0A%0A
     @Ove
@@ -862,40 +862,50 @@
     
-CraftingHelper.addShapelessRecip
+recipeDuplicateList.add(new RecipeDuplicat
 e(ne
@@ -986,17 +986,19 @@
 chine%22))
-;
+);%0A
 %0A       
@@ -1002,128 +1002,100 @@
     
-CraftingHelper.addShapelessRecipe( IC2Items.getItem(%22resource%22,%22machine%22), new ItemStack(ModBlocks.machineframe, 0, 1));
+for(RecipeDuplicate duplicate : recipeDuplicateList)%7B%0A            duplicate.add();%0A        %7D
 %0A   
@@ -1265,10 +1265,422 @@
 %0A%0A    %7D%0A
+%0A    public class RecipeDuplicate %7B%0A%0A        ItemStack stack1;%0A%0A        ItemStack stack2;%0A%0A        public RecipeDuplicate(ItemStack stack1, ItemStack stack2) %7B%0A            this.stack1 = stack1;%0A            this.stack2 = stack2;%0A        %7D%0A%0A        public void add()%7B%0A%0A            CraftingHelper.addShapelessRecipe(stack2, stack1);%0A            CraftingHelper.addShapelessRecipe(stack1, stack2);%0A%0A        %7D%0A%0A    %7D%0A%0A
 %7D%0A

Clean up ic2 recipes a little