Explosion (PneumaticCraft: Repressurized)
Description
Converts an input item into an output item, with a chance to fail and destroy the item.
Tip
Consider using the inWorldCrafting Explosion compat instead!
Identifier
Refer to this via any of the following:
mods.pneumaticcraft.explosion/* Used as page default */
mods.pneumaticcraft.Explosion
Adding Recipes
Add the given recipe to the recipe list:
groovymods.pneumaticcraft.explosion.add(ExplosionCraftingRecipe)
Recipe Builder
Just like other recipe types, the Explosion also uses a recipe builder.
Don't know what a builder is? Check the builder info page out.
mods.pneumaticcraft.explosion.recipeBuilder()
IngredientList<IIngredient>
. Sets the item inputs of the recipe. Requires exactly 1.groovyinput(IIngredient) input(IIngredient...) input(Collection<IIngredient>)
ItemStackList
. Sets the item outputs of the recipe. Requires exactly 1.groovyoutput(ItemStack) output(ItemStack...) output(Collection<ItemStack>)
int
. Sets the failure rate of the recipe, where the item is simply destroyed instead of being converted. Requires greater than or equal to 0. (Default0
).groovylossRate(int)
First validates the builder, returning
null
and outputting errors to the log file if the validation failed, then registers the builder and returns the registered object. (returnsnull
orme.desht.pneumaticcraft.common.recipes.ExplosionCraftingRecipe
).groovyregister()
Example
mods.pneumaticcraft.explosion.recipeBuilder()
.input(item('minecraft:clay'))
.output(item('minecraft:gold_ingot'))
.lossRate(40)
.register()
mods.pneumaticcraft.explosion.recipeBuilder()
.input(item('minecraft:diamond'))
.output(item('minecraft:obsidian'))
.register()
Removing Recipes
Removes the given recipe from the recipe list:
groovymods.pneumaticcraft.explosion.remove(ExplosionCraftingRecipe)
Removes all recipes that match the given input:
groovymods.pneumaticcraft.explosion.removeByInput(IIngredient)
Removes all recipes that match the given output:
groovymods.pneumaticcraft.explosion.removeByOutput(IIngredient)
Removes all registered recipes:
groovymods.pneumaticcraft.explosion.removeAll()
Example
mods.pneumaticcraft.explosion.removeByInput(item('minecraft:iron_block'))
mods.pneumaticcraft.explosion.removeByOutput(item('pneumaticcraft:compressed_iron_block'))
mods.pneumaticcraft.explosion.removeAll()
Getting the value of recipes
Iterates through every entry in the registry, with the ability to call remove on any element to remove it:
groovymods.pneumaticcraft.explosion.streamRecipes()