Search in sources :

Example 21 with IItemStack

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));
}
Also used : ItemStack(net.minecraft.item.ItemStack) IItemStack(crafttweaker.api.item.IItemStack) ZenMethod(stanhebben.zenscript.annotations.ZenMethod)

Example 22 with IItemStack

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);
}
Also used : LumbermillRecipe(binnie.extratrees.machines.lumbermill.recipes.LumbermillRecipe) ItemStack(net.minecraft.item.ItemStack) IItemStack(crafttweaker.api.item.IItemStack) ZenMethod(stanhebben.zenscript.annotations.ZenMethod)

Example 23 with IItemStack

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;
    }
}
Also used : IIngredient(crafttweaker.api.item.IIngredient) IItemStack(crafttweaker.api.item.IItemStack) IOreDictEntry(crafttweaker.api.oredict.IOreDictEntry) IngredientStack(crafttweaker.api.item.IngredientStack)

Example 24 with IItemStack

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;
    }
}
Also used : IIngredient(crafttweaker.api.item.IIngredient) IItemStack(crafttweaker.api.item.IItemStack) IOreDictEntry(crafttweaker.api.oredict.IOreDictEntry) IngredientStack(crafttweaker.api.item.IngredientStack)

Aggregations

IItemStack (crafttweaker.api.item.IItemStack)24 ItemStack (net.minecraft.item.ItemStack)18 ZenMethod (stanhebben.zenscript.annotations.ZenMethod)14 IIngredient (crafttweaker.api.item.IIngredient)4 FluidStack (net.minecraftforge.fluids.FluidStack)4 IAction (crafttweaker.IAction)2 IngredientStack (crafttweaker.api.item.IngredientStack)2 CraftTweakerMC (crafttweaker.api.minecraft.CraftTweakerMC)2 IOreDictEntry (crafttweaker.api.oredict.IOreDictEntry)2 PackingRecipe (betterwithaddons.crafting.recipes.PackingRecipe)1 IngredientCraftTweaker (betterwithaddons.util.IngredientCraftTweaker)1 BrewedGrainRecipe (binnie.extratrees.machines.brewery.recipes.BrewedGrainRecipe)1 BreweryRecipe (binnie.extratrees.machines.brewery.recipes.BreweryRecipe)1 FruitPressRecipe (binnie.extratrees.machines.fruitpress.recipes.FruitPressRecipe)1 LumbermillRecipe (binnie.extratrees.machines.lumbermill.recipes.LumbermillRecipe)1 ComparableItemStack (blusunrize.immersiveengineering.api.ComparableItemStack)1 MetalPressRecipe (blusunrize.immersiveengineering.api.crafting.MetalPressRecipe)1 GristSet (com.mraof.minestuck.util.GristSet)1 IMod (crafttweaker.api.mods.IMod)1 BracketHandlerItem (crafttweaker.mc1120.brackets.BracketHandlerItem)1