Ancestral Infusion Crafting (Better With Addons)
Description
Converts a custom crafting recipe an output itemstack, consuming Spirits from the Infused Soul Sand placed below the Ancestral Infuser if placed within the appropriate multiblock. The multiblock is either Soul Sand or Infused Soul Sand placed below the Ancestral Infuser and exclusively air blocks adjacent to the Infuser and Soul Sand blocks.
Identifier
Refer to this via any of the following:
mods.betterwithaddons.infuser/* Used as page default */
mods.betterwithaddons.Infuser
Adding Recipes
Add the given recipe to the recipe list:
groovymods.betterwithaddons.infuser.add(InfuserRecipe)
Recipe Builder
Just like other recipe types, the Ancestral Infusion Crafting also uses a recipe builder.
Don't know what a builder is? Check the builder info page out.
mods.betterwithaddons.infuser.shapedBuilder()
ResourceLocation
. Sets the Resource Location of the recipe.groovyname(String) name(ResourceLocation)
String[]
. Sets the items required in each slot of the grid as char. Requires either the key-based matrix or the ingredient-based matrix can be defined, not both.groovyrow(String) shape(String...) matrix(String...)
List<List<IIngredient>>
. Sets the items required in each slot in the grid as IIngredients. Requires greater than or equal to 1, less than or equal to 9, and either the key-based matrix or the ingredient-based matrix can be defined, not both.groovyshape(List<List<IIngredient>>) matrix(List<List<IIngredient>>)
Char2ObjectOpenHashMap<IIngredient>
. Sets the item the given char corresponds to. (Default' ' = IIngredient.EMPTY
).groovykey(char, IIngredient) key(String, IIngredient) key(Map<String, IIngredient>)
ItemStack
. Sets the item output. Requires not null.groovyoutput(ItemStack)
int
. Sets the amount of spirits consumed. Requires greater than or equal to 0. (Default0
).groovyspirits(int)
boolean
. Sets if the recipe is horizontally mirrored. (Defaultfalse
).groovymirrored() mirrored(boolean)
Closure<ItemStack>
. Sets an operation that modifies the input items or output item.groovyrecipeFunction(Closure<ItemStack>)
Closure<Void>
. Sets an operation that happens when the recipe is crafted.groovyrecipeAction(Closure<Void>)
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
orbetterwithaddons.crafting.recipes.infuser.InfuserRecipe
).groovyregister()
Example
mods.betterwithaddons.infuser.shapedBuilder()
.output(item('minecraft:stone'))
.matrix('BXX',
'X B')
.key('B', item('minecraft:stone'))
.key('X', item('minecraft:gold_ingot'))
.spirits(1)
.mirrored()
.register()
mods.betterwithaddons.infuser.shapedBuilder()
.output(item('minecraft:diamond') * 32)
.matrix([[item('minecraft:gold_ingot'), item('minecraft:gold_ingot'), item('minecraft:gold_ingot')],
[item('minecraft:gold_ingot'), item('minecraft:gold_ingot'), item('minecraft:gold_ingot')],
[item('minecraft:gold_ingot'), item('minecraft:gold_ingot'), item('minecraft:gold_ingot')]])
.spirits(6)
.register()
mods.betterwithaddons.infuser.shapelessBuilder()
ResourceLocation
. Sets the Resource Location of the recipe.groovyname(String) name(ResourceLocation)
List<IIngredient>
. Sets the items required for the recipe. Requires greater than or equal to 1 and less than or equal to 9.groovyinput(IIngredient) input(IIngredient...) input(Collection<IIngredient>)
ItemStack
. Sets the item output. Requires not null.groovyoutput(ItemStack)
int
. Sets the amount of spirits consumed. Requires greater than or equal to 0. (Default0
).groovyspirits(int)
Closure<ItemStack>
. Sets an operation that modifies the input items or output item.groovyrecipeFunction(Closure<ItemStack>)
Closure<Void>
. Sets an operation that happens when the recipe is crafted.groovyrecipeAction(Closure<Void>)
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
orbetterwithaddons.crafting.recipes.infuser.InfuserRecipe
).groovyregister()
Example
mods.betterwithaddons.infuser.shapelessBuilder()
.output(item('minecraft:clay') * 8)
.input(item('minecraft:stone'), item('minecraft:stone'), item('minecraft:stone'))
.register()
mods.betterwithaddons.infuser.shapelessBuilder()
.output(item('minecraft:clay') * 32)
.input(item('minecraft:diamond'), item('minecraft:diamond'), item('minecraft:diamond'), item('minecraft:diamond'), item('minecraft:diamond'), item('minecraft:diamond'), item('minecraft:diamond'), item('minecraft:diamond'))
.spirits(8)
.register()
Removing Recipes
Removes the given recipe from the recipe list:
groovymods.betterwithaddons.infuser.remove(InfuserRecipe)
Removes all recipes that match the given input:
groovymods.betterwithaddons.infuser.removeByInput(IIngredient)
Removes all recipes that match the given output:
groovymods.betterwithaddons.infuser.removeByOutput(IIngredient)
Removes all registered recipes:
groovymods.betterwithaddons.infuser.removeAll()
Example
mods.betterwithaddons.infuser.removeByInput(item('betterwithaddons:japanmat:16'))
mods.betterwithaddons.infuser.removeByOutput(item('betterwithaddons:ya'))
mods.betterwithaddons.infuser.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.betterwithaddons.infuser.streamRecipes()