use of crafttweaker.api.item.IItemStack in project Minestuck by mraof.
the class Combinations method removeRecipe.
@ZenMethod
public static void removeRecipe(IItemStack input1, IItemStack input2, String mode) {
ItemStack stack1 = (ItemStack) input1.getInternal();
ItemStack stack2 = (ItemStack) input2.getInternal();
recipes.add(new SetRecipe(stack1.getItem(), stack1.getItemDamage(), stack2.getItem(), stack2.getItemDamage(), getMode(mode), null));
}
use of crafttweaker.api.item.IItemStack in project Binnie by ForestryMC.
the class LumbermillRecipeHandler method addRecipe.
@ZenMethod
public static void addRecipe(IItemStack input, IItemStack output) {
ItemStack inputStack = CraftTweakerUtil.getItemStack(input);
ItemStack outputStack = CraftTweakerUtil.getItemStack(output);
addRecipe(new LumbermillRecipe(inputStack, outputStack), ExtraTreesRecipeManager.lumbermillManager);
}
use of crafttweaker.api.item.IItemStack 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.IItemStack 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