Crusher (Immersive Engineering)
Description
Converts an input itemstack into an output itemstack with optional additional chanced item outputs, consuming energy.
Identifier
Refer to this via any of the following:
mods.ie.crusher
mods.ie.Crusher
mods.immersiveengineering.crusher/* Used as page default */
mods.immersiveengineering.Crusher
Adding Recipes
Add the given recipe to the recipe list:
groovymods.immersiveengineering.crusher.add(CrusherRecipe)
Adds recipes in the format
output
,input
,energy
:groovymods.immersiveengineering.crusher.add(ItemStack, IIngredient, int)
Recipe Builder
Just like other recipe types, the Crusher also uses a recipe builder.
Don't know what a builder is? Check the builder info page out.
mods.immersiveengineering.crusher.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 amount of power consumed to complete the recipe. Requires greater than or equal to 0. (Default0
).groovyenergy(int)
List<ItemStack>
. Sets the additional items output by the recipe, if any. Requires exactly equal to the number of elements insecondaryOutputChances
.groovysecondaryOutput(ItemStack) secondaryOutput(ItemStack, float)
FloatArrayList
. Sets the chance of the respective additional items output by the recipe. Requires exactly equal to the number of elements insecondaryOutputItems
.groovysecondaryOutput(ItemStack) secondaryOutput(ItemStack, float)
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
orblusunrize.immersiveengineering.api.crafting.CrusherRecipe
).groovyregister()
Example
mods.immersiveengineering.crusher.recipeBuilder()
.input(item('minecraft:diamond'))
.output(item('minecraft:clay'))
.energy(100)
.register()
mods.immersiveengineering.crusher.recipeBuilder()
.input(item('minecraft:diamond_block'))
.output(item('minecraft:diamond'))
.secondaryOutput(item('minecraft:gold_ingot'))
.secondaryOutput(item('minecraft:gold_ingot'), 0.3)
.energy(100)
.register()
Removing Recipes
Removes the given recipe from the recipe list:
groovymods.immersiveengineering.crusher.remove(CrusherRecipe)
Removes all recipes that match the given input:
groovymods.immersiveengineering.crusher.removeByInput(ItemStack)
Removes all recipes that match the given output:
groovymods.immersiveengineering.crusher.removeByOutput(ItemStack)
Removes all registered recipes:
groovymods.immersiveengineering.crusher.removeAll()
Example
mods.immersiveengineering.crusher.removeByInput(item('immersiveengineering:material:7'))
mods.immersiveengineering.crusher.removeByOutput(item('minecraft:sand'))
mods.immersiveengineering.crusher.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.immersiveengineering.crusher.streamRecipes()