Search in sources :

Example 96 with ZenMethod

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

the class Chemicals method addDamageEffect.

@ZenMethod
public static void addDamageEffect(IIngredient ingredient, double damage) {
    PharmacologyEffect effect = new PharmacologyEffect.Damage((float) damage);
    addEffect(ingredient, effect);
}
Also used : PharmacologyEffect(minechem.potion.PharmacologyEffect) ZenMethod(stanhebben.zenscript.annotations.ZenMethod)

Example 97 with ZenMethod

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

the class Chemicals method removeMoleculeEffects.

@ZenMethod
public static void removeMoleculeEffects(IIngredient ingredient) {
    PotionChemical chemical = InputHelper.getChemical(ingredient);
    if (!(chemical instanceof Molecule)) {
        throw new IllegalArgumentException("Ingredient is not a molecule");
    }
    MineTweakerAPI.apply(new RemoveEffectsAction(((Molecule) chemical).molecule));
}
Also used : Molecule(minechem.item.molecule.Molecule) PotionChemical(minechem.potion.PotionChemical) ZenMethod(stanhebben.zenscript.annotations.ZenMethod)

Example 98 with ZenMethod

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

the class Chemicals method addMolecule.

@ZenMethod
public static void addMolecule(String name, int id, String roomState, IIngredient[] chemicals) {
    ChemicalRoomStateEnum state = InputHelper.getRoomState(roomState);
    if (MoleculeEnum.getByName(name) != null || MoleculeEnum.getById(id) != null) {
        throw new IllegalArgumentException(name + " is already registered as a molecule");
    }
    ArrayList<PotionChemical> chem = InputHelper.getChemicals(chemicals);
    PotionChemical[] chemical = chem.toArray(new PotionChemical[chem.size()]);
    MineTweakerAPI.apply(new AddMoleculeAction(name, id, state, chemical));
}
Also used : PotionChemical(minechem.potion.PotionChemical) ChemicalRoomStateEnum(minechem.item.ChemicalRoomStateEnum) ZenMethod(stanhebben.zenscript.annotations.ZenMethod)

Example 99 with ZenMethod

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

the class Mixer method addRecipe.

@ZenMethod
public static void addRecipe(ILiquidStack output, ILiquidStack fluidInput, IIngredient[] itemInputs, int energy) {
    Object[] adds = null;
    if (itemInputs != null) {
        adds = new Object[itemInputs.length];
        for (int i = 0; i < itemInputs.length; i++) adds[i] = CraftTweakerHelper.toObject(itemInputs[i]);
    }
    MixerRecipe r = new MixerRecipe(CraftTweakerHelper.toFluidStack(output), CraftTweakerHelper.toFluidStack(fluidInput), adds, energy);
    CraftTweakerAPI.apply(new Add(r));
}
Also used : MixerRecipe(blusunrize.immersiveengineering.api.crafting.MixerRecipe) ZenMethod(stanhebben.zenscript.annotations.ZenMethod)

Example 100 with ZenMethod

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

the class AlloySmelter method addRecipe.

@ZenMethod
public static void addRecipe(IItemStack output, IIngredient first, IIngredient second, int time) {
    Object oFirst = CraftTweakerHelper.toObject(first), oSecond = CraftTweakerHelper.toObject(second);
    if (oFirst == null || oSecond == null)
        return;
    AlloyRecipe r = new AlloyRecipe(CraftTweakerHelper.toStack(output), oFirst, oSecond, time);
    CraftTweakerAPI.apply(new Add(r));
}
Also used : AlloyRecipe(blusunrize.immersiveengineering.api.crafting.AlloyRecipe) 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