2014-07-07 17:22:21 +02:00
|
|
|
package com.pahimar.ee3.api.recipe;
|
2014-07-03 22:00:25 +02:00
|
|
|
|
2014-07-07 17:22:21 +02:00
|
|
|
import com.pahimar.ee3.api.core.OreStack;
|
2014-07-03 22:00:25 +02:00
|
|
|
import net.minecraft.item.ItemStack;
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.List;
|
|
|
|
|
2014-07-04 21:18:10 +02:00
|
|
|
public class RecipesAludel
|
|
|
|
{
|
2014-07-03 22:00:25 +02:00
|
|
|
private static RecipesAludel aludelRegistry = null;
|
|
|
|
|
|
|
|
private List<RecipeAludel> aludelRecipes;
|
|
|
|
|
2014-07-04 21:18:10 +02:00
|
|
|
private RecipesAludel()
|
|
|
|
{
|
2014-07-03 22:00:25 +02:00
|
|
|
aludelRecipes = new ArrayList<RecipeAludel>();
|
|
|
|
}
|
|
|
|
|
2014-07-04 21:18:10 +02:00
|
|
|
public static RecipesAludel getInstance()
|
|
|
|
{
|
|
|
|
if (aludelRegistry == null)
|
|
|
|
{
|
2014-07-03 22:00:25 +02:00
|
|
|
aludelRegistry = new RecipesAludel();
|
|
|
|
}
|
|
|
|
|
|
|
|
return aludelRegistry;
|
|
|
|
}
|
|
|
|
|
2014-07-04 21:18:10 +02:00
|
|
|
public void addRecipe(ItemStack recipeOutput, ItemStack recipeInputStack, ItemStack recipeInputDust)
|
|
|
|
{
|
2014-07-03 22:00:25 +02:00
|
|
|
addRecipe(new RecipeAludel(recipeOutput, recipeInputStack, recipeInputDust));
|
|
|
|
}
|
|
|
|
|
2014-07-04 21:18:10 +02:00
|
|
|
public void addRecipe(RecipeAludel recipeAludel)
|
|
|
|
{
|
|
|
|
if (!aludelRecipes.contains(recipeAludel))
|
|
|
|
{
|
2014-07-03 22:00:25 +02:00
|
|
|
aludelRecipes.add(recipeAludel);
|
2014-07-04 21:18:10 +02:00
|
|
|
}
|
2014-07-03 22:00:25 +02:00
|
|
|
}
|
|
|
|
|
2014-07-04 21:18:10 +02:00
|
|
|
public void addRecipe(ItemStack recipeOutput, OreStack recipeInputStack, ItemStack recipeInputDust)
|
|
|
|
{
|
|
|
|
addRecipe(new RecipeAludel(recipeOutput, recipeInputStack, recipeInputDust));
|
|
|
|
}
|
|
|
|
|
|
|
|
public ItemStack getResult(ItemStack recipeInputStack, ItemStack recipeInputDust)
|
|
|
|
{
|
|
|
|
for (RecipeAludel recipeAludel : aludelRecipes)
|
|
|
|
{
|
|
|
|
if (recipeAludel.matches(recipeInputStack, recipeInputDust))
|
|
|
|
{
|
2014-07-03 22:00:25 +02:00
|
|
|
return recipeAludel.getRecipeOutput();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
2014-07-04 21:18:10 +02:00
|
|
|
public RecipeAludel getRecipe(ItemStack recipeInputStack, ItemStack recipeInputDust)
|
|
|
|
{
|
|
|
|
for (RecipeAludel recipeAludel : aludelRecipes)
|
|
|
|
{
|
|
|
|
if (recipeAludel.matches(recipeInputStack, recipeInputDust))
|
|
|
|
{
|
2014-07-03 22:00:25 +02:00
|
|
|
return recipeAludel;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
2014-07-04 21:18:10 +02:00
|
|
|
public List<RecipeAludel> getRecipes()
|
|
|
|
{
|
2014-07-03 22:00:25 +02:00
|
|
|
return aludelRecipes;
|
|
|
|
}
|
|
|
|
}
|