Search in sources :

Example 31 with ZenMethod

use of stanhebben.zenscript.annotations.ZenMethod in project ImmersiveEngineering by BluSunrize.

the class Refinery method addRecipe.

@ZenMethod
public static void addRecipe(ILiquidStack output, ILiquidStack input0, ILiquidStack input1, int energy) {
    FluidStack fOut = CraftTweakerHelper.toFluidStack(output);
    FluidStack fIn0 = CraftTweakerHelper.toFluidStack(input0);
    FluidStack fIn1 = CraftTweakerHelper.toFluidStack(input1);
    if (fOut == null || fIn0 == null || fIn1 == null)
        return;
    RefineryRecipe r = new RefineryRecipe(fOut, fIn0, fIn1, energy);
    CraftTweakerAPI.apply(new Add(r));
}
Also used : RefineryRecipe(blusunrize.immersiveengineering.api.crafting.RefineryRecipe) FluidStack(net.minecraftforge.fluids.FluidStack) ZenMethod(stanhebben.zenscript.annotations.ZenMethod)

Example 32 with ZenMethod

use of stanhebben.zenscript.annotations.ZenMethod in project ImmersiveEngineering by BluSunrize.

the class ArcFurnace method addRecipe.

@ZenMethod
public static void addRecipe(IItemStack output, IIngredient input, IItemStack slag, int time, int energyPerTick, @Optional IIngredient[] additives, @Optional String specialRecipeType) {
    Object oInput = CraftTweakerHelper.toObject(input);
    if (oInput == null)
        return;
    Object[] adds = null;
    if (additives != null) {
        adds = new Object[additives.length];
        for (int i = 0; i < additives.length; i++) adds[i] = CraftTweakerHelper.toObject(additives[i]);
    }
    ArcFurnaceRecipe r = new ArcFurnaceRecipe(CraftTweakerHelper.toStack(output), oInput, CraftTweakerHelper.toStack(slag), time, energyPerTick, adds);
    if (specialRecipeType != null)
        r.setSpecialRecipeType(specialRecipeType);
    CraftTweakerAPI.apply(new Add(r));
}
Also used : ArcFurnaceRecipe(blusunrize.immersiveengineering.api.crafting.ArcFurnaceRecipe) ZenMethod(stanhebben.zenscript.annotations.ZenMethod)

Example 33 with ZenMethod

use of stanhebben.zenscript.annotations.ZenMethod in project ImmersiveEngineering by BluSunrize.

the class Squeezer method addRecipe.

@ZenMethod
public static void addRecipe(IItemStack output, ILiquidStack fluid, IIngredient input, int energy) {
    if (CraftTweakerHelper.toObject(input) == null)
        return;
    // Either output or fluid must not be null.
    if (CraftTweakerHelper.toStack(output).isEmpty() && (CraftTweakerHelper.toFluidStack(fluid) == null || CraftTweakerHelper.toFluidStack(fluid).getFluid() == null))
        return;
    SqueezerRecipe r = new SqueezerRecipe(CraftTweakerHelper.toFluidStack(fluid), CraftTweakerHelper.toStack(output), CraftTweakerHelper.toObject(input), energy);
    CraftTweakerAPI.apply(new Add(r));
}
Also used : SqueezerRecipe(blusunrize.immersiveengineering.api.crafting.SqueezerRecipe) ZenMethod(stanhebben.zenscript.annotations.ZenMethod)

Example 34 with ZenMethod

use of stanhebben.zenscript.annotations.ZenMethod in project BetterStorage by copygirl.

the class MTCraftingStation method addShapeless.

@ZenMethod
public static void addShapeless(IItemStack[] output, IIngredient[] input, @Optional int experience, @Optional int craftingTime) {
    ItemStack[] recipeOutput = MTHelper.toStacks(output);
    IStationRecipe recipe = new MTShapelessStationRecipe(input, recipeOutput, experience, craftingTime);
    MineTweakerAPI.apply(new UndoableRecipeAddAction(recipe, recipeOutput));
}
Also used : IItemStack(minetweaker.api.item.IItemStack) ItemStack(net.minecraft.item.ItemStack) IStationRecipe(net.mcft.copy.betterstorage.api.crafting.IStationRecipe) ZenMethod(stanhebben.zenscript.annotations.ZenMethod)

Example 35 with ZenMethod

use of stanhebben.zenscript.annotations.ZenMethod in project BetterWithAddons by DaedalusGame.

the class DryingBox method add.

@ZenMethod
public static void add(IItemStack output, IItemStack input) {
    CherryBoxRecipe recipe = new CherryBoxRecipe(BlockCherryBox.CherryBoxType.DRYING, InputHelper.toObject(input), InputHelper.toStack(output));
    MineTweakerAPI.apply(new Add("DryingBox", DryingBoxRecipeCategory.UID, CraftingManagerDryingBox.instance(), Lists.newArrayList(recipe)));
}
Also used : CherryBoxRecipe(betterwithaddons.crafting.recipes.CherryBoxRecipe) ZenMethod(stanhebben.zenscript.annotations.ZenMethod)

Aggregations

ZenMethod (stanhebben.zenscript.annotations.ZenMethod)67 ItemStack (net.minecraft.item.ItemStack)23 IItemStack (crafttweaker.api.item.IItemStack)14 FluidStack (net.minecraftforge.fluids.FluidStack)7 PharmacologyEffect (minechem.potion.PharmacologyEffect)6 IItemStack (minetweaker.api.item.IItemStack)6 PotionChemical (minechem.potion.PotionChemical)4 NetRecipe (betterwithaddons.crafting.recipes.NetRecipe)3 CherryBoxRecipe (betterwithaddons.crafting.recipes.CherryBoxRecipe)2 GristSet (com.mraof.minestuck.util.GristSet)2 IAction (crafttweaker.IAction)2 ChemicalRoomStateEnum (minechem.item.ChemicalRoomStateEnum)2 PackingRecipe (betterwithaddons.crafting.recipes.PackingRecipe)1 SmeltingRecipe (betterwithaddons.crafting.recipes.SmeltingRecipe)1 SpindleRecipe (betterwithaddons.crafting.recipes.SpindleRecipe)1 WoodHardness (betterwithaddons.handler.StumpingHandler.WoodHardness)1 ItemMaterial (betterwithaddons.item.ItemMaterial)1 TreeFood (betterwithaddons.tileentity.TileEntityLureTree.TreeFood)1 IngredientCraftTweaker (betterwithaddons.util.IngredientCraftTweaker)1 BrewedGrainRecipe (binnie.extratrees.machines.brewery.recipes.BrewedGrainRecipe)1