package gr8pefish.openglider.common.registry;

import gr8pefish.openglider.common.item.ItemHangGlider;
import gr8pefish.openglider.common.item.ItemHangGliderPart;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fml.common.registry.GameRegistry;
import net.minecraftforge.oredict.ShapedOreRecipe;

public class ItemRegistry {

    private static ItemHangGlider glider;
    private static ItemHangGliderPart gliderPart;

    public static void registerItems(){
        glider = new ItemHangGlider();
        gliderPart = new ItemHangGliderPart();
    }

    public static void registerRecipes() {

        //Left wing
        GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ItemRegistry.gliderPart, 1, 0),
                " sl",
                "sll",
                "lll",
                's', "stickWood", 'l', "leather"));

        //Right wing
        GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ItemRegistry.gliderPart, 1, 1),
                "ls ",
                "lls",
                "lll",
                's', "stickWood", 'l', "leather"));

        //Scaffolding
        GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ItemRegistry.gliderPart, 1, 2),
                "iii",
                "isi",
                " i ",
                'i', "ingotIron", 'l', "string"));

        //Glider
        GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ItemRegistry.glider, 1),
                "",
                "lsr",
                "",
                'l', new ItemStack(ItemRegistry.gliderPart, 1, 0), 's', new ItemStack(ItemRegistry.gliderPart, 1, 2),
                'r', new ItemStack(ItemRegistry.gliderPart, 1, 1)));
    }

}

@@ -156,16 +156,48 @@
 erPart;%0A
+import net.minecraft.item.Item;%0A
 import n
@@ -520,74 +520,225 @@
 r = 
-new ItemHangGlider();%0A        gliderPart = new ItemHangGliderPart(
+(ItemHangGlider) registerItem(new ItemHangGlider(), %22itemHangGlider%22); //ToDO: ask in IRC name enforcement for 1.11%0A        gliderPart = (ItemHangGliderPart) registerItem(new ItemHangGliderPart(), %22itemHangGliderPart%22
 );%0A 
@@ -1870,10 +1870,214 @@
 %0A    %7D%0A%0A
+    //Helper methods for registration%0A%0A    private static Item registerItem(Item item, String name) %7B%0A        item.setRegistryName(name);%0A        GameRegistry.register(item);%0A        return item;%0A    %7D%0A%0A%0A
 %7D%0A

Add method actually register items