Packing (Better With Addons)
Description
Converts an input itemstack in the form of a EntityItems into an IBlockState after a piston extends if the piston and location the EntityItems are in are fully surrounded by solid blocks.
Identifier
Refer to this via any of the following:
mods.betterwithaddons.packing/* Used as page default */
mods.betterwithaddons.Packing
Adding Recipes
Add the given recipe to the recipe list:
groovymods.betterwithaddons.packing.add(PackingRecipe)
Recipe Builder
Just like other recipe types, the Packing 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.betterwithaddons.packing.recipeBuilder()
IngredientList<IIngredient>
. Sets the item inputs of the recipe. Requires exactly 1.groovyinput(IIngredient) input(IIngredient...) input(Collection<IIngredient>)
IBlockState
. Sets the IBlockState that the input is compacted into. Requires not null.groovycompress(IBlockState)
ItemStack
. Sets output that appears in JEI, but has no bearing on the actual recipe. Requires not null. (Defaultcompress as ItemStack
).groovyjeiOutput(ItemStack)
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.PackingRecipe
).groovyregister()
Example
mods.betterwithaddons.packing.recipeBuilder()
.input(item('minecraft:gold_ingot'))
.compress(blockstate('minecraft:clay'))
.register()
mods.betterwithaddons.packing.recipeBuilder()
.input(item('minecraft:clay') * 10)
.compress(blockstate('minecraft:diamond_block'))
.register()
mods.betterwithaddons.packing.recipeBuilder()
.input(item('minecraft:diamond'))
.compress(blockstate('minecraft:dirt'))
.jeiOutput(item('minecraft:diamond') * 64)
.register()
Removing Recipes
Removes the given recipe from the recipe list:
groovymods.betterwithaddons.packing.remove(PackingRecipe)
Removes all recipes that match the given input:
groovymods.betterwithaddons.packing.removeByInput(IIngredient)
Removes all recipes that match the given output:
groovymods.betterwithaddons.packing.removeByOutput(IBlockState)
Removes all registered recipes:
groovymods.betterwithaddons.packing.removeAll()
Example
mods.betterwithaddons.packing.removeByInput(item('minecraft:clay_ball'))
mods.betterwithaddons.packing.removeByOutput(blockstate('minecraft:gravel'))
mods.betterwithaddons.packing.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.packing.streamRecipes()