Playing around with a smarter RecipesVanilla
This commit is contained in:
parent
5863efcee6
commit
beec013625
1 changed files with 30 additions and 2 deletions
|
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue