Cables now work in Recipes.

Added Ingredient Resolver Sets.
Shrunk MC Chest Battery.
This commit is contained in:
AlgorithmX2
2014-03-09 21:11:29 -05:00
parent dfd24a6756
commit d5748eb804
8 changed files with 191 additions and 16 deletions
+10 -4
View File
@@ -11,7 +11,8 @@ import appeng.api.exceptions.MissingIngredientError;
import appeng.api.exceptions.RecipeError;
import appeng.api.exceptions.RegistrationError;
import appeng.api.recipes.IIngredient;
import appeng.api.recipes.ResolveResult;
import appeng.api.recipes.ResolverResult;
import appeng.api.recipes.ResolverResultSet;
import cpw.mods.fml.common.registry.GameRegistry;
public class Ingredient implements IIngredient
@@ -25,7 +26,7 @@ public class Ingredient implements IIngredient
final public int qty;
public Ingredient(RecipeHandler handler, String input, int qty) throws RecipeError {
public Ingredient(RecipeHandler handler, String input, int qty) throws RecipeError, MissedIngredientSet {
// works no matter wat!
this.qty = qty;
@@ -60,12 +61,17 @@ public class Ingredient implements IIngredient
{
try
{
ResolveResult rr = AEApi.instance().registries().recipes().resolveItem( nameSpace, tmpName );
if ( rr != null )
Object ro = AEApi.instance().registries().recipes().resolveItem( nameSpace, tmpName );
if ( ro instanceof ResolverResult )
{
ResolverResult rr = (ResolverResult) ro;
tmpName = rr.itemName;
sel = rr.damageValue;
}
else if ( ro instanceof ResolverResultSet )
{
throw new MissedIngredientSet( (ResolverResultSet) ro );
}
}
catch (IllegalArgumentException e)
{