Search in sources :

Example 11 with IItemStack

use of crafttweaker.api.item.IItemStack in project Binnie by ForestryMC.

the class FruitPressRecipeHandler method addRecipe.

@ZenMethod
public static void addRecipe(IItemStack input, ILiquidStack output) {
    ItemStack inputStack = CraftTweakerUtil.getItemStack(input);
    FluidStack outputStack = CraftTweakerUtil.getLiquidStack(output);
    addRecipe(new FruitPressRecipe(inputStack, outputStack), ExtraTreesRecipeManager.fruitPressManager);
}
Also used : FruitPressRecipe(binnie.extratrees.machines.fruitpress.recipes.FruitPressRecipe) FluidStack(net.minecraftforge.fluids.FluidStack) ItemStack(net.minecraft.item.ItemStack) IItemStack(crafttweaker.api.item.IItemStack) ZenMethod(stanhebben.zenscript.annotations.ZenMethod)

Example 12 with IItemStack

use of crafttweaker.api.item.IItemStack in project ImmersiveEngineering by BluSunrize.

the class MetalPress method addRecipe.

@ZenMethod
public static void addRecipe(IItemStack output, IIngredient input, IItemStack mold, int energy, @Optional int inputSize) {
    Object oInput = CraftTweakerHelper.toObject(input);
    if (oInput == null)
        return;
    ItemStack sOut = CraftTweakerHelper.toStack(output);
    ItemStack sMold = CraftTweakerHelper.toStack(mold);
    if (!sOut.isEmpty() && !sMold.isEmpty()) {
        MetalPressRecipe r = new MetalPressRecipe(sOut, oInput, ApiUtils.createComparableItemStack(sMold, true), energy);
        if (inputSize > 0)
            r.setInputSize(inputSize);
        CraftTweakerAPI.apply(new Add(r));
    }
}
Also used : MetalPressRecipe(blusunrize.immersiveengineering.api.crafting.MetalPressRecipe) ComparableItemStack(blusunrize.immersiveengineering.api.ComparableItemStack) ItemStack(net.minecraft.item.ItemStack) IItemStack(crafttweaker.api.item.IItemStack) ZenMethod(stanhebben.zenscript.annotations.ZenMethod)

Example 13 with IItemStack

use of crafttweaker.api.item.IItemStack in project GregTech by GregTechCE.

the class RecipeMap method ctFindRecipe.

@ZenMethod("findRecipe")
@Method(modid = GTValues.MODID_CT)
@Nullable
public CTRecipe ctFindRecipe(long maxVoltage, IItemStack[] itemInputs, ILiquidStack[] fluidInputs, @Optional(valueLong = Integer.MAX_VALUE) int outputFluidTankCapacity) {
    List<ItemStack> mcItemInputs = itemInputs == null ? Collections.emptyList() : Arrays.stream(itemInputs).map(CraftTweakerMC::getItemStack).collect(Collectors.toList());
    List<FluidStack> mcFluidInputs = fluidInputs == null ? Collections.emptyList() : Arrays.stream(fluidInputs).map(CraftTweakerMC::getLiquidStack).collect(Collectors.toList());
    Recipe backingRecipe = findRecipe(maxVoltage, mcItemInputs, mcFluidInputs, outputFluidTankCapacity);
    return backingRecipe == null ? null : new CTRecipe(this, backingRecipe);
}
Also used : CTRecipe(gregtech.api.recipes.crafttweaker.CTRecipe) CraftTweakerMC(crafttweaker.api.minecraft.CraftTweakerMC) FluidStack(net.minecraftforge.fluids.FluidStack) CTRecipe(gregtech.api.recipes.crafttweaker.CTRecipe) ItemStack(net.minecraft.item.ItemStack) IItemStack(crafttweaker.api.item.IItemStack) Method(net.minecraftforge.fml.common.Optional.Method) Nullable(javax.annotation.Nullable)

Example 14 with IItemStack

use of crafttweaker.api.item.IItemStack in project BetterWithAddons by DaedalusGame.

the class Packing method add.

@ZenMethod
public static void add(IItemStack output, IIngredient input) {
    ItemStack stack = CraftTweakerMC.getItemStack(output);
    if (stack.getItem() instanceof ItemBlock) {
        Block block = ((ItemBlock) stack.getItem()).getBlock();
        PackingRecipe r = new PackingRecipe(new IngredientCraftTweaker(input), block.getStateFromMeta(stack.getMetadata()));
        r.setJeiOutput(stack);
        CraftTweaker.LATE_ACTIONS.add(new Add(r));
    }
}
Also used : PackingRecipe(betterwithaddons.crafting.recipes.PackingRecipe) Block(net.minecraft.block.Block) ItemBlock(net.minecraft.item.ItemBlock) IngredientCraftTweaker(betterwithaddons.util.IngredientCraftTweaker) ItemStack(net.minecraft.item.ItemStack) IItemStack(crafttweaker.api.item.IItemStack) ItemBlock(net.minecraft.item.ItemBlock) ZenMethod(stanhebben.zenscript.annotations.ZenMethod)

Example 15 with IItemStack

use of crafttweaker.api.item.IItemStack in project Charset by CharsetMC.

the class MaterialRegistry method registerTypes.

@ZenMethod
public static boolean registerTypes(IItemStack stack, String... tags) {
    ItemStack mcStack = CraftTweakerMC.getItemStack(stack);
    if (mcStack.isEmpty()) {
        return false;
    }
    CraftTweakerAPI.apply(new IAction() {

        @Override
        public void apply() {
            ItemMaterial material = ItemMaterialRegistry.INSTANCE.getOrCreateMaterial(mcStack);
            ItemMaterialRegistry.INSTANCE.registerTypes(material, tags);
        }

        @Override
        public String describe() {
            return "Registering stack " + stack + " as material with types " + JOINER.join(tags);
        }
    });
    return true;
}
Also used : IAction(crafttweaker.IAction) ItemMaterial(pl.asie.charset.lib.material.ItemMaterial) ItemStack(net.minecraft.item.ItemStack) IItemStack(crafttweaker.api.item.IItemStack) ZenMethod(stanhebben.zenscript.annotations.ZenMethod)

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