API at 99%
This commit is contained in:
parent
30e18429ec
commit
446b98219e
11 changed files with 117 additions and 104 deletions
|
@ -4,13 +4,17 @@ import java.util.LinkedList;
|
|||
import java.util.List;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import WayofTime.alchemicalWizardry.api.altarRecipeRegistry.AltarRecipe;
|
||||
|
||||
public class BindingRegistry
|
||||
{
|
||||
public static List<BindingRecipe> bindingRecipes = new LinkedList();
|
||||
|
||||
public static boolean isRequiredItemValid(ItemStack testItem, int currentTierAltar)
|
||||
public static void registerRecipe(ItemStack output, ItemStack input)
|
||||
{
|
||||
bindingRecipes.add(new BindingRecipe(output, input));
|
||||
}
|
||||
|
||||
public static boolean isRequiredItemValid(ItemStack testItem)
|
||||
{
|
||||
for(BindingRecipe recipe : bindingRecipes)
|
||||
{
|
||||
|
@ -23,7 +27,7 @@ public class BindingRegistry
|
|||
return false;
|
||||
}
|
||||
|
||||
public static ItemStack getItemForItemAndTier(ItemStack testItem, int currentTierAltar)
|
||||
public static ItemStack getItemForItemAndTier(ItemStack testItem)
|
||||
{
|
||||
for(BindingRecipe recipe : bindingRecipes)
|
||||
{
|
||||
|
@ -35,4 +39,29 @@ public class BindingRegistry
|
|||
|
||||
return null;
|
||||
}
|
||||
|
||||
public static int getIndexForItem(ItemStack testItem)
|
||||
{
|
||||
int i=0;
|
||||
for(BindingRecipe recipe : bindingRecipes)
|
||||
{
|
||||
if(recipe.doesRequiredItemMatch(testItem))
|
||||
{
|
||||
return i;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
public static ItemStack getOutputForIndex(int index)
|
||||
{
|
||||
if(bindingRecipes.size()<=index)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return bindingRecipes.get(index).getResult();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue