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));
}
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));
}
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));
}
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));
}
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)));
}
Aggregations