Scrapbox (Tech Reborn)
Description
Converts a scrapbox into a random itemstack output, either via manual player interaction or via a machine with a given process time, consuming energy per tick.
Identifier
The identifier mods.techreborn.scrapbox will be used as the default on this page.
All Identifiers
Any of these can be used to refer to this compat:
mods.techreborn.scrapbox/* Used as page default */
mods.techreborn.ScrapboxAdding Recipes
Add the given recipe to the recipe list:
groovymods.techreborn.scrapbox.add(R)
Recipe Builder
Just like other recipe types, the Scrapbox also uses a recipe builder.
Don't know what a builder is? Check the builder info page out.
Recipe Builder
Create the Recipe Builder.
groovymods.techreborn.scrapbox.recipeBuilder()
ItemStackList. Sets the item outputs of the recipe. Requires exactly 1.groovyoutput(ItemStack) output(ItemStack...) output(Collection<ItemStack>)int. Sets the time in ticks the recipe takes to complete. Requires greater than or equal to 0. (Default0).groovytime(int)int. Sets the power consumed per tick. Requires greater than or equal to 0. (Default0).groovyperTick(int)
First validates the builder, returning
nulland outputting errors to the log file if the validation failed, then registers the builder and returns the registered object. (returnsnullortechreborn.api.recipe.machines.ScrapboxRecipe).groovyregister()
Example
mods.techreborn.scrapbox.recipeBuilder()
.output(item('minecraft:clay'))
.register()
mods.techreborn.scrapbox.recipeBuilder()
.output(item('minecraft:gold_block'))
.time(2)
.perTick(100)
.register()Removing Recipes
Removes the given recipe from the recipe list:
groovymods.techreborn.scrapbox.remove(R)Removes all recipes that match the given output:
groovymods.techreborn.scrapbox.removeByOutput(IIngredient)Removes all registered recipes:
groovymods.techreborn.scrapbox.removeAll()
Example
mods.techreborn.scrapbox.removeByOutput(item('minecraft:diamond'))
mods.techreborn.scrapbox.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.techreborn.scrapbox.streamRecipes()
