Recipe API Update.

This commit is contained in:
AlgorithmX2
2014-02-19 17:33:36 -06:00
parent 85b053f6b5
commit bea8f2cc07
26 changed files with 292 additions and 203 deletions
+12 -11
View File
@@ -4,25 +4,26 @@ import java.util.ArrayList;
import java.util.List;
import net.minecraft.item.ItemStack;
import appeng.api.exceptions.MissingIngredientError;
import appeng.api.exceptions.RecipeError;
import appeng.api.exceptions.RegistrationError;
import appeng.api.recipes.ICraftHandler;
import appeng.api.recipes.IIngredient;
import appeng.core.AELog;
import appeng.recipes.Ingredient;
import appeng.recipes.MissingIngredientError;
import appeng.recipes.RecipeError;
import appeng.recipes.RegistrationError;
import appeng.recipes.Recipes.ShapedRecipe;
import cpw.mods.fml.common.registry.GameRegistry;
public class Shaped extends CraftHandler
public class Shaped implements ICraftHandler
{
private int rows;
private int cols;
List<List<Ingredient>> inputs;
Ingredient output;
List<List<IIngredient>> inputs;
IIngredient output;
@Override
public void setup(List<List<Ingredient>> input, List<List<Ingredient>> output) throws RecipeError
public void setup(List<List<IIngredient>> input, List<List<IIngredient>> output) throws RecipeError
{
if ( output.size() == 1 && output.get( 0 ).size() == 1 )
{
@@ -48,20 +49,20 @@ public class Shaped extends CraftHandler
public void register() throws RegistrationError, MissingIngredientError
{
char first = 'A';
List<Object> args = new ArrayList();
List<Object> args = new ArrayList<Object>();
for (int y = 0; y < rows; y++)
{
String row = "";
for (int x = 0; x < cols; x++)
{
if ( inputs.get( y ).get( x ).isAir )
if ( inputs.get( y ).get( x ).isAir() )
row = row + " ";
else
{
row = row + first;
args.add( first );
args.add( inputs.get( y ).get( x ).getSet() );
args.add( inputs.get( y ).get( x ).getItemStackSet() );
first++;
}