Applied-Energistics-2-tiler.../recipes/handlers/OreRegistration.java

42 lines
912 B
Java
Raw Normal View History

package appeng.recipes.handlers;
import java.util.List;
import net.minecraft.item.ItemStack;
import net.minecraftforge.oredict.OreDictionary;
2014-02-20 00:33:36 +01:00
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;
2014-02-20 00:33:36 +01:00
public class OreRegistration implements ICraftHandler
{
2014-02-20 00:33:36 +01:00
List<IIngredient> inputs;
String name;
2014-02-20 00:33:36 +01:00
public OreRegistration(List<IIngredient> in, String out) {
inputs = in;
name = out;
}
@Override
public void register() throws RegistrationError, MissingIngredientError
{
2014-02-20 00:33:36 +01:00
for (IIngredient i : inputs)
{
2014-02-20 00:33:36 +01:00
for (ItemStack is : i.getItemStackSet())
{
OreDictionary.registerOre( name, is );
}
}
}
2014-02-20 00:33:36 +01:00
@Override
public void setup(List<List<IIngredient>> input,
List<List<IIngredient>> output) throws RecipeError {
}
}