mirror of
https://github.com/GTNewHorizons/BloodMagic.git
synced 2026-11-27 07:13:14 +00:00
Added in Unbinding Ritual recipes (UnbindingRegistry.registerRecipe(outputItemStack, inputItemStack)) and automatic reversion of registered Binding Recipes. Renamed Binding Ritual class, updated ritual blacklist. Blood Magic, now with 8% more lightning!
This commit is contained in:
1 parent
1eefcda6ca
commit
9247e66f13
7 files changed
+177
-22
No files matched your search
@@ -0,0 +1,62 @@
|
||||
package WayofTime.alchemicalWizardry.api.bindingRegistry;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
public class UnbindingRegistry
|
||||
{
|
||||
public static List<UnbindingRecipe> unbindingRecipes = new LinkedList();
|
||||
|
||||
public static void addAllUnbindingRecipesFromBinding()
|
||||
{
|
||||
for (BindingRecipe bindingRecipe : BindingRegistry.bindingRecipes)
|
||||
{
|
||||
unbindingRecipes.add(new UnbindingRecipe(bindingRecipe.requiredItem, bindingRecipe.outputItem));
|
||||
}
|
||||
}
|
||||
|
||||
public static void registerRecipe(ItemStack output, ItemStack input)
|
||||
{
|
||||
unbindingRecipes.add(new UnbindingRecipe(output, input));
|
||||
}
|
||||
|
||||
public static boolean isRequiredItemValid(ItemStack testItem)
|
||||
{
|
||||
for (UnbindingRecipe recipe : unbindingRecipes)
|
||||
{
|
||||
if (recipe.doesRequiredItemMatch(testItem))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public static int getIndexForItem(ItemStack testItem)
|
||||
{
|
||||
int i = 0;
|
||||
for (UnbindingRecipe recipe : unbindingRecipes)
|
||||
{
|
||||
if (recipe.doesRequiredItemMatch(testItem))
|
||||
{
|
||||
return i;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
public static ItemStack getOutputForIndex(int index)
|
||||
{
|
||||
if (unbindingRecipes.size() <= index)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return unbindingRecipes.get(index).getResult();
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user