Playing around with a smarter RecipesVanilla

This commit is contained in:
pahimar 2013-12-16 23:08:46 -05:00
parent 5863efcee6
commit beec013625

View file

@ -2,6 +2,7 @@ package com.pahimar.ee3.item.crafting;
import com.google.common.collect.HashMultimap;
import com.google.common.collect.Multimap;
import com.pahimar.ee3.core.helper.ItemHelper;
import com.pahimar.ee3.core.helper.LogHelper;
import com.pahimar.ee3.core.helper.RecipeHelper;
import com.pahimar.ee3.item.WrappedStack;
@ -9,7 +10,11 @@ import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.CraftingManager;
import net.minecraft.item.crafting.IRecipe;
import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
public class RecipesVanilla
@ -39,8 +44,7 @@ public class RecipesVanilla
{
// TODO Handle different IRecipe types here
LogHelper.debug(recipeObject.getClass().getCanonicalName());
experimentalHandleIC2AdvRecipe((IRecipe) recipeObject);
IRecipe recipe = (IRecipe) recipeObject;
ItemStack recipeOutput = recipe.getRecipeOutput();
@ -58,4 +62,28 @@ public class RecipesVanilla
}
}
}
private static void experimentalHandleIC2AdvRecipe(IRecipe recipeObject)
{
if (recipeObject.getClass().getCanonicalName().equalsIgnoreCase("ic2.core.AdvRecipe"))
{
try
{
Object object = Class.forName("ic2.core.AdvRecipe").getDeclaredField("output").get(recipeObject);
LogHelper.debug(object);
}
catch (IllegalAccessException e)
{
e.printStackTrace();
}
catch (NoSuchFieldException e)
{
e.printStackTrace();
}
catch (ClassNotFoundException e)
{
e.printStackTrace();
}
}
}
}