Crusher (Actually Additions)
Description
Converts an input itemstack into an output itemstack with a chance of a second itemstack.
Identifier
Refer to this via any of the following:
mods.aa.crusher
mods.aa.Crusher
mods.actuallyadditions.crusher/* Used as page default */
mods.actuallyadditions.Crusher
Adding Recipes
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.actuallyadditions.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 greater than or equal to 1 and less than or equal to 2.groovyoutput(ItemStack) output(ItemStack...) output(Collection<ItemStack>)
int
. Sets the chance for the second output entry to be output. Requires greater than or equal to 0 and less than or equal to 100. (Default0
).groovychance(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
orde.ellpeck.actuallyadditions.api.recipe.CrusherRecipe
).groovyregister()
Example
mods.actuallyadditions.crusher.recipeBuilder()
.input(item('minecraft:clay'))
.output(item('minecraft:diamond'), item('minecraft:diamond'))
.chance(100)
.register()
mods.actuallyadditions.crusher.recipeBuilder()
.input(item('minecraft:diamond_block'))
.output(item('minecraft:diamond') * 12)
.register()
Removing Recipes
Removes all recipes that match the given input:
groovymods.actuallyadditions.crusher.removeByInput(IIngredient)
Removes all recipes that match the given output:
groovymods.actuallyadditions.crusher.removeByOutput(ItemStack)
Removes all registered recipes:
groovymods.actuallyadditions.crusher.removeAll()
Example
mods.actuallyadditions.crusher.removeByInput(item('minecraft:bone'))
mods.actuallyadditions.crusher.removeByOutput(item('minecraft:sugar'))
mods.actuallyadditions.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.actuallyadditions.crusher.streamRecipes()