int sel = 0;
if ( nameSpace.equals( "oreDictionary" ) )
{
if ( parts.length == 3 )
throw new RecipeError( "Cannot specify meta when using ore dictionary." );
sel = OreDictionary.WILDCARD_VALUE;
}
else
{
try
{
Object ro = AEApi.instance().registries().recipes().resolveItem( nameSpace, tmpName );
if ( ro instanceof ResolverResult )
{
ResolverResult rr = (ResolverResult) ro;
tmpName = rr.itemName;
sel = rr.damageValue;
nbt = rr.compound;
}
else if ( ro instanceof ResolverResultSet )
{
throw new MissedIngredientSet( (ResolverResultSet) ro );
}
}
catch (IllegalArgumentException e)
{
throw new RecipeError( tmpName + " is not a valid ae2 item definition." );
}
}
meta = sel;
}
else
{
if ( parts[2].equals( "*" ) )
{
meta = OreDictionary.WILDCARD_VALUE;
}
else
{
try
{
meta = Integer.parseInt( parts[2] );
}
catch (NumberFormatException e)
{
throw new RecipeError( "Invalid Metadata." );
}
}
}
itemName = tmpName;
}
else
throw new RecipeError( input + " : Needs at least Namespace and Name." );
handler.data.knownItem.add( toString() );
}