Recipe API Update.
This commit is contained in:
@@ -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++;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user