use of crafttweaker.api.item.IngredientStack in project ImmersiveEngineering by BluSunrize.
the class CraftTweakerHelper method toIEIngredientStack.
public static blusunrize.immersiveengineering.api.crafting.IngredientStack toIEIngredientStack(IIngredient iStack) {
if (iStack == null)
return null;
else {
if (iStack instanceof IOreDictEntry)
return new blusunrize.immersiveengineering.api.crafting.IngredientStack(((IOreDictEntry) iStack).getName());
else if (iStack instanceof IItemStack)
return new blusunrize.immersiveengineering.api.crafting.IngredientStack(toStack((IItemStack) iStack));
else if (iStack instanceof IngredientStack) {
IIngredient ingr = ReflectionHelper.getPrivateValue(IngredientStack.class, (IngredientStack) iStack, "ingredient");
blusunrize.immersiveengineering.api.crafting.IngredientStack ingrStack = toIEIngredientStack(ingr);
ingrStack.inputSize = iStack.getAmount();
return ingrStack;
} else
return null;
}
}
use of crafttweaker.api.item.IngredientStack in project ImmersiveEngineering by BluSunrize.
the class CraftTweakerHelper method toObject.
public static Object toObject(IIngredient iStack) {
if (iStack == null)
return null;
else {
if (iStack instanceof IOreDictEntry)
return ((IOreDictEntry) iStack).getName();
else if (iStack instanceof IItemStack)
return toStack((IItemStack) iStack);
else if (iStack instanceof IngredientStack) {
IIngredient ingr = ReflectionHelper.getPrivateValue(IngredientStack.class, (IngredientStack) iStack, "ingredient");
Object o = toObject(ingr);
if (o instanceof String)
return new blusunrize.immersiveengineering.api.crafting.IngredientStack((String) o, iStack.getAmount());
else
return o;
} else
return null;
}
}
Aggregations