Search in sources :

Example 91 with ZenMethod

use of stanhebben.zenscript.annotations.ZenMethod 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 92 with ZenMethod

use of stanhebben.zenscript.annotations.ZenMethod 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)

Example 93 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();
    recipes.add(new SetRecipe(stack1.getItem(), stack1.getItemDamage(), stack2.getItem(), stack2.getItemDamage(), getMode(mode), null));
}
Also used : ItemStack(net.minecraft.item.ItemStack) IItemStack(crafttweaker.api.item.IItemStack) ZenMethod(stanhebben.zenscript.annotations.ZenMethod)

Example 94 with ZenMethod

use of stanhebben.zenscript.annotations.ZenMethod in project Minechem by iopleke.

the class Decomposer method addRecipe.

/**
 * Add Recipe
 *
 * @param input as input stack
 * @param chance	chance of output (Optional)
 * @param multiOutputs as Ingredient stack array
 */
@ZenMethod
public static void addRecipe(IIngredient input, @Optional double chance, IIngredient[]... multiOutputs) {
    if (multiOutputs.length == 1) {
        IIngredient[] outputs = multiOutputs[0];
        ArrayList<PotionChemical> output = InputHelper.getChemicals(outputs);
        if (output.size() == outputs.length) {
            ArrayList<ItemStack> toAdd = InputHelper.getInputs(input);
            for (ItemStack addInput : toAdd) {
                if (chance == 0 || chance >= 1) {
                    MineTweakerAPI.apply(new AddRecipeAction(addInput, output));
                } else if (chance < 1) {
                    MineTweakerAPI.apply(new AddRecipeAction(addInput, (float) chance, InputHelper.getArray(output)));
                }
            }
        } else {
            addSuperRecipe(input, outputs, output);
        }
    } else {
        addMultiRecipe(input, multiOutputs, chance);
    }
}
Also used : IIngredient(minetweaker.api.item.IIngredient) PotionChemical(minechem.potion.PotionChemical) ItemStack(net.minecraft.item.ItemStack) ZenMethod(stanhebben.zenscript.annotations.ZenMethod)

Example 95 with ZenMethod

use of stanhebben.zenscript.annotations.ZenMethod in project Minechem by iopleke.

the class Chemicals method addCureEffect.

@ZenMethod
public static void addCureEffect(IIngredient ingredient) {
    PharmacologyEffect effect = new PharmacologyEffect.Cure();
    addEffect(ingredient, effect);
}
Also used : PharmacologyEffect(minechem.potion.PharmacologyEffect) 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