Search in sources :

Example 51 with ZenMethod

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

the class PressRecipeTweaker method remove.

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

Example 52 with ZenMethod

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

the class GrindstoneRecipeTweaker method add.

@ZenMethod
public static void add(IIngredient input, IItemStack output, int time, @Optional boolean hand, @Optional IItemStack secondary, @Optional int secondaryChance) {
    List<IItemStack> items = input.getItems();
    if (items == null) {
        HorsePowerMod.logger.error("Cannot turn " + input.toString() + " into a grinding recipe");
    }
    ItemStack[] items2 = getItemStacks(items);
    ItemStack output2 = getItemStack(output);
    ItemStack secondary2 = getItemStack(secondary);
    AddGrindstoneRecipe recipe = new AddGrindstoneRecipe(input, items2, output2, secondary2, secondaryChance, 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 53 with ZenMethod

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

the class Alchemy method removeCost.

@ZenMethod
public static void removeCost(IItemStack iStack) {
    ItemStack stack = (ItemStack) iStack.getInternal();
    MineTweakerAPI.apply(new SetCost(stack.getItem(), stack.getItemDamage(), null));
}
Also used : IItemStack(minetweaker.api.item.IItemStack) ItemStack(net.minecraft.item.ItemStack) ZenMethod(stanhebben.zenscript.annotations.ZenMethod)

Example 54 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();
    MineTweakerAPI.apply(new SetRecipe(stack.getItem(), stack.getItemDamage(), input2, OreDictionary.WILDCARD_VALUE, getMode(mode), (ItemStack) output.getInternal()));
}
Also used : IItemStack(minetweaker.api.item.IItemStack) ItemStack(net.minecraft.item.ItemStack) ZenMethod(stanhebben.zenscript.annotations.ZenMethod)

Example 55 with ZenMethod

use of stanhebben.zenscript.annotations.ZenMethod 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();
    MineTweakerAPI.apply(new SetRecipe(stack1.getItem(), stack1.getItemDamage(), stack2.getItem(), stack2.getItemDamage(), getMode(mode), null));
}
Also used : IItemStack(minetweaker.api.item.IItemStack) ItemStack(net.minecraft.item.ItemStack) ZenMethod(stanhebben.zenscript.annotations.ZenMethod)

Aggregations

ZenMethod (stanhebben.zenscript.annotations.ZenMethod)147 ItemStack (net.minecraft.item.ItemStack)52 IItemStack (minetweaker.api.item.IItemStack)28 IItemStack (crafttweaker.api.item.IItemStack)23 EntityPlayer (net.minecraft.entity.player.EntityPlayer)16 FluidStack (net.minecraftforge.fluids.FluidStack)10 IDecayCapability (thebetweenlands.api.capability.IDecayCapability)8 PharmacologyEffect (minechem.potion.PharmacologyEffect)6 IIngredient (crafttweaker.api.item.IIngredient)5 RecipeData (com.mrcrayfish.furniture.api.RecipeData)4 IThirst (toughasnails.api.stat.capability.IThirst)4 NetRecipe (betterwithaddons.crafting.recipes.NetRecipe)3 TableRecipeShaped (com.blakebr0.extendedcrafting.crafting.table.TableRecipeShaped)3 ZenDoc (crafttweaker.annotations.ZenDoc)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