equivalent-exchange-3/src/main/java/com/pahimar/ee3/recipe/RecipesVanilla.java

43 lines
1.4 KiB
Java
Raw Normal View History

package com.pahimar.ee3.recipe;
import com.pahimar.ee3.api.RecipeRegistryProxy;
import com.pahimar.ee3.exchange.WrappedStack;
import com.pahimar.ee3.util.RecipeHelper;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.CraftingManager;
import net.minecraft.item.crafting.IRecipe;
import net.minecraft.item.crafting.ShapedRecipes;
import net.minecraft.item.crafting.ShapelessRecipes;
import net.minecraftforge.oredict.ShapedOreRecipe;
import net.minecraftforge.oredict.ShapelessOreRecipe;
import java.util.List;
public class RecipesVanilla
{
2014-07-24 22:01:42 +02:00
public static void registerRecipes()
{
for (Object recipeObject : CraftingManager.getInstance().getRecipeList())
{
/**
* Vanilla
*/
if (recipeObject instanceof ShapedRecipes || recipeObject instanceof ShapelessRecipes || recipeObject instanceof ShapedOreRecipe || recipeObject instanceof ShapelessOreRecipe)
{
IRecipe recipe = (IRecipe) recipeObject;
ItemStack recipeOutput = recipe.getRecipeOutput();
if (recipeOutput != null)
{
2014-07-22 03:43:04 +02:00
List<WrappedStack> recipeInputs = RecipeHelper.getRecipeInputs(recipe);
if (!recipeInputs.isEmpty())
{
RecipeRegistryProxy.addRecipe(recipeOutput, recipeInputs);
}
}
}
}
}
}