Search in sources :

Example 46 with ZenMethod

use of stanhebben.zenscript.annotations.ZenMethod in project Minestuck by mraof.

the class Combinations method addRecipe.

@ZenMethod
public static void addRecipe(IItemStack input1, IItemStack input2, String mode, IItemStack output) {
    ItemStack stack1 = (ItemStack) input1.getInternal();
    ItemStack stack2 = (ItemStack) input2.getInternal();
    recipes.add(new SetRecipe(stack1.getItem(), stack1.getItemDamage(), stack2.getItem(), stack2.getItemDamage(), getMode(mode), (ItemStack) output.getInternal()));
}
Also used : ItemStack(net.minecraft.item.ItemStack) IItemStack(crafttweaker.api.item.IItemStack) ZenMethod(stanhebben.zenscript.annotations.ZenMethod)

Example 47 with ZenMethod

use of stanhebben.zenscript.annotations.ZenMethod in project Minestuck by mraof.

the class Combinations method addOreDictRecipe.

@ZenMethod
public static void addOreDictRecipe(IItemStack input1, String input2, String mode, IItemStack output) {
    ItemStack stack = (ItemStack) input1.getInternal();
    recipes.add(new SetRecipe(stack.getItem(), stack.getItemDamage(), input2, OreDictionary.WILDCARD_VALUE, getMode(mode), (ItemStack) output.getInternal()));
}
Also used : ItemStack(net.minecraft.item.ItemStack) IItemStack(crafttweaker.api.item.IItemStack) ZenMethod(stanhebben.zenscript.annotations.ZenMethod)

Example 48 with ZenMethod

use of stanhebben.zenscript.annotations.ZenMethod in project HorsePower by GoryMoon.

the class ChoppingRecipeTweaker method add.

@ZenMethod
public static void add(IIngredient input, IItemStack output, int time, @Optional boolean hand) {
    List<IItemStack> items = input.getItems();
    if (items == null) {
        HorsePowerMod.logger.error("Cannot turn " + input.toString() + " into a chopping recipe");
    }
    ItemStack[] items2 = getItemStacks(items);
    ItemStack output2 = getItemStack(output);
    AddChoppingRecipe recipe = new AddChoppingRecipe(input, items2, output2, ItemStack.EMPTY, 0, time, hand);
    MineTweakerAPI.apply(recipe);
    TweakerPluginImpl.actions.add(recipe);
}
Also used : IItemStack(minetweaker.api.item.IItemStack) IItemStack(minetweaker.api.item.IItemStack) ItemStack(net.minecraft.item.ItemStack) MineTweakerMC.getItemStack(minetweaker.api.minecraft.MineTweakerMC.getItemStack) ZenMethod(stanhebben.zenscript.annotations.ZenMethod)

Example 49 with ZenMethod

use of stanhebben.zenscript.annotations.ZenMethod in project HorsePower by GoryMoon.

the class ChoppingRecipeTweaker method remove.

@ZenMethod
public static void remove(IIngredient output, @Optional boolean hand) {
    List<ChoppingBlockRecipe> toRemove = Lists.newArrayList();
    List<Integer> removeIndex = Lists.newArrayList();
    for (int i = 0; i < HPRecipes.instance().getGrindstoneRecipes().size(); i++) {
        ChoppingBlockRecipe recipe = HPRecipes.instance().getChoppingRecipes().get(i);
        if (OreDictionary.itemMatches(MineTweakerMC.getItemStack(output), recipe.getOutput(), false)) {
            toRemove.add(recipe);
            removeIndex.add(i);
        }
    }
    RemoveChoppingRecipe recipe = new RemoveChoppingRecipe(toRemove, removeIndex, hand);
    MineTweakerAPI.apply(recipe);
    TweakerPluginImpl.actions.add(recipe);
}
Also used : ChoppingBlockRecipe(se.gory_moon.horsepower.recipes.ChoppingBlockRecipe) ZenMethod(stanhebben.zenscript.annotations.ZenMethod)

Example 50 with ZenMethod

use of stanhebben.zenscript.annotations.ZenMethod in project HorsePower by GoryMoon.

the class PressRecipeTweaker method add.

@ZenMethod
public static void add(IIngredient input, IItemStack output) {
    List<IItemStack> items = input.getItems();
    if (items == null) {
        HorsePowerMod.logger.error("Cannot turn " + input.toString() + " into a press recipe");
    }
    ItemStack[] items2 = getItemStacks(items);
    ItemStack output2 = getItemStack(output);
    AddPressRecipe recipe = new AddPressRecipe(input, items2, output2, ItemStack.EMPTY, 0, 0);
    MineTweakerAPI.apply(recipe);
    TweakerPluginImpl.actions.add(recipe);
}
Also used : IItemStack(minetweaker.api.item.IItemStack) IItemStack(minetweaker.api.item.IItemStack) ItemStack(net.minecraft.item.ItemStack) MineTweakerMC.getItemStack(minetweaker.api.minecraft.MineTweakerMC.getItemStack) ZenMethod(stanhebben.zenscript.annotations.ZenMethod)

Aggregations

ZenMethod (stanhebben.zenscript.annotations.ZenMethod)113 ItemStack (net.minecraft.item.ItemStack)50 IItemStack (minetweaker.api.item.IItemStack)28 IItemStack (crafttweaker.api.item.IItemStack)19 FluidStack (net.minecraftforge.fluids.FluidStack)10 PharmacologyEffect (minechem.potion.PharmacologyEffect)6 IIngredient (crafttweaker.api.item.IIngredient)4 NetRecipe (betterwithaddons.crafting.recipes.NetRecipe)3 TableRecipeShaped (com.blakebr0.extendedcrafting.crafting.table.TableRecipeShaped)3 IEnchantment (crafttweaker.api.enchantments.IEnchantment)3 HashMap (java.util.HashMap)3 Function (java.util.function.Function)3 PotionChemical (minechem.potion.PotionChemical)3 MineTweakerMC.getItemStack (minetweaker.api.minecraft.MineTweakerMC.getItemStack)3 Ingredient (net.minecraft.item.crafting.Ingredient)3 CherryBoxRecipe (betterwithaddons.crafting.recipes.CherryBoxRecipe)2 TableRecipeShapeless (com.blakebr0.extendedcrafting.crafting.table.TableRecipeShapeless)2 GristSet (com.mraof.minestuck.util.GristSet)2 IAction (crafttweaker.IAction)2 FluidType (gregtech.api.fluids.fluidType.FluidType)2