AE2 First Commit, the dawn of 1.7 hast arrived.
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
package appeng.recipes;
|
||||
|
||||
import java.util.Iterator;
|
||||
|
||||
public class Recipe
|
||||
{
|
||||
|
||||
final int size;
|
||||
final RecipeType type;
|
||||
final RecipeItem items[];
|
||||
|
||||
public Recipe(RecipeType rt, Iterator<RecipeItem> ilist) throws RecipeError {
|
||||
type = rt;
|
||||
items = new RecipeItem[rt.getSize()];
|
||||
|
||||
int itemCount = 0;
|
||||
while (itemCount < rt.getSize() && ilist.hasNext())
|
||||
{
|
||||
items[itemCount++] = ilist.next();
|
||||
}
|
||||
|
||||
if ( ilist.hasNext() )
|
||||
throw new RecipeError( "Invalid Number of Items in recipe." );
|
||||
|
||||
if ( rt.isShaped() )
|
||||
{
|
||||
if ( itemCount != rt.getSize() )
|
||||
throw new RecipeError( "Invalid Number of Items in recipe." );
|
||||
|
||||
size = rt.getSize();
|
||||
}
|
||||
else
|
||||
size = itemCount;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user