Played around a bit more with the guide. Added a simple recipe getter for the recipe pages.

This commit is contained in:
WayofTime 2016-06-05 14:12:28 -04:00
parent 7c1cbb2503
commit 9e7517459e
4 changed files with 59 additions and 8 deletions

View file

@ -0,0 +1,28 @@
package WayofTime.bloodmagic.util.helper;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.CraftingManager;
import net.minecraft.item.crafting.IRecipe;
public class RecipeHelper
{
public static IRecipe getRecipeForOutput(ItemStack stack)
{
for (IRecipe recipe : CraftingManager.getInstance().getRecipeList())
{
if (recipe != null)
{
ItemStack resultStack = recipe.getRecipeOutput();
if (resultStack != null && resultStack.getItem() != null)
{
if (resultStack.getItem() == stack.getItem() && resultStack.getItemDamage() == stack.getItemDamage())
{
return recipe;
}
}
}
}
return null;
}
}