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