/*
 * Copyright (c) 2014, William <w.cameron@crookedhill.co.nz>
 * 
 * Permission to use, copy, modify, and/or distribute this software for any
 * purpose with or without fee is hereby granted, provided that the above
 * copyright notice and this permission notice appear in all copies.
 *
 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 */

package nz.co.crookedhill.ggutils.util;

import java.util.List;
import java.util.ArrayList;

import net.minecraft.item.crafting.ShapedRecipes;
import net.minecraft.item.crafting.ShapelessRecipes;

public class GGURecipeManager 
{
	
	private static List<ShapedRecipes> shapedRecipes = new ArrayList<ShapedRecipes>();
	private static List<ShapelessRecipes> shapelessRecipes = new ArrayList<ShapelessRecipes>();
	
	/**
	 * gets the list of recipes from the crafting manager and sorts them into multiple lists to 
	 * reduse lookup time during the game.
	 * @param recipeList list of recipes from CraftingManager
	 */
	public static void init(List recipeList) 
	{
		for(int i = 0; i<recipeList.size();i++)
		{
			if(recipeList.get(i) instanceof ShapedRecipes) 
			{
				//if(((ShapedRecipes)recipeList.get(i)).getRecipeOutput() != null)
					shapedRecipes.add(((ShapedRecipes)recipeList.get(i)));
			}
			else if(recipeList.get(i) instanceof ShapelessRecipes) 
			{
				if(((ShapelessRecipes)recipeList.get(i)).getRecipeOutput() != null)
					shapelessRecipes.add(((ShapelessRecipes)recipeList.get(i)));
			}
		}
	}
	
	public static List<ShapedRecipes> getShaped() 
	{
		return shapedRecipes;
		
	}
	public static List<ShapelessRecipes> getShapeless() 
	{
		return shapelessRecipes;
		
	}
}

@@ -1026,16 +1026,99 @@
 ger %0A%7B%0A%09
+/**%0A%09 * list of all shaped recipes found in the CraftingManager's Recipe List.%0A%09 */
 %0A%09privat
@@ -1194,16 +1194,104 @@
 pes%3E();%0A
+%09/**%0A%09 * list of all shapeless recipes found in the CraftingManager's Recipe List.%0A%09 */%0A
 %09private
@@ -2079,16 +2079,64 @@
 %09%09%7D%0A%09%7D%0A%09
+/**%0A%09 * returns the list of shaped recipes.%0A%09 */
 %0A%09public
@@ -2209,16 +2209,66 @@
 ;%0A%09%09%0A%09%7D%0A
+%09/**%0A%09 * returns the list of shaped recipes.%0A%09 */%0A
 %09public 

Update GGURecipeManager.java