Grindstone (Astral Sorcery)
Description
Converts an item into an itemstack with a chance of getting twice the amount after right clicking the grindstone based on weight.
Identifier
Refer to this via any of the following:
mods.astralsorcery.grindstone/* Used as page default */
mods.astralsorcery.Grindstone
mods.astral.grindstone
mods.astral.Grindstone
Adding Recipes
Adds a recipe in the format of
input
,output
,weight
, with thesecondaryChance
being 0:groovymods.astralsorcery.grindstone.add(ItemHandle, ItemStack, int)
Adds a recipe in the format of
input
,output
,weight
,secondaryChance
:groovymods.astralsorcery.grindstone.add(ItemHandle, ItemStack, int, float)
Recipe Builder
Just like other recipe types, the Grindstone also uses a recipe builder.
Don't know what a builder is? Check the builder info page out.
mods.astralsorcery.grindstone.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 how many interactions it takes to process the recipe. Requires greater than or equal to 0. (Default0
).groovyweight(int)
float
. Sets the chance of an additional output. Requires greater than or equal to 0 and less than or equal to 1. (Default0.0f
).groovysecondaryChance(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
orhellfirepvp.astralsorcery.common.crafting.grindstone.GrindstoneRecipe
).groovyregister()
Example
mods.astralsorcery.grindstone.recipeBuilder()
.input(ore('blockDiamond'))
.output(item('minecraft:clay'))
.weight(1)
.secondaryChance(1.0F)
.register()
mods.astralsorcery.grindstone.recipeBuilder()
.input(item('minecraft:stone'))
.output(item('minecraft:cobblestone'))
.weight(5)
.register()
Removing Recipes
Removes all recipes that match the given input:
groovymods.astralsorcery.grindstone.removeByInput(ItemStack)
Removes all recipes that match the given output:
groovymods.astralsorcery.grindstone.removeByOutput(ItemStack)
Removes all recipes that match the given output:
groovymods.astralsorcery.grindstone.removeByOutput(OreDictIngredient)
Removes all registered recipes:
groovymods.astralsorcery.grindstone.removeAll()
Example
mods.astralsorcery.grindstone.removeByInput(item('minecraft:redstone_ore'))
mods.astralsorcery.grindstone.removeByOutput(ore('dustIron'))
mods.astralsorcery.grindstone.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.astralsorcery.grindstone.streamRecipes()