Moved Recipe Registration to Init, Added Recipe Baking.

This commit is contained in:
AlgorithmX2
2014-07-25 17:49:49 -05:00
parent 846e8a0384
commit 31cb594f4d
10 changed files with 135 additions and 63 deletions
+11
View File
@@ -26,6 +26,8 @@ public class Ingredient implements IIngredient
final public int qty;
ItemStack[] baked;
public Ingredient(RecipeHandler handler, String input, int qty) throws RecipeError, MissedIngredientSet {
// works no matter wat!
@@ -159,6 +161,9 @@ public class Ingredient implements IIngredient
@Override
public ItemStack[] getItemStackSet() throws RegistrationError, MissingIngredientError
{
if ( baked != null )
return baked;
if ( nameSpace.equalsIgnoreCase( "oreDictionary" ) )
{
List<ItemStack> ores = OreDictionary.getOres( itemName );
@@ -211,4 +216,10 @@ public class Ingredient implements IIngredient
return isAir;
}
@Override
public void bake() throws RegistrationError, MissingIngredientError
{
baked = getItemStackSet();
}
}