Enum RecipeRule
#[non_exhaustive]pub enum RecipeRule {
Show 15 variants
Stonecutting {
input: Ingredient,
result: ItemStack,
},
SmithingTransform {
template: Option<Ingredient>,
base: Ingredient,
addition: Option<Ingredient>,
result: RecipeTemplate,
},
SmithingTrim {
template: Ingredient,
base: Ingredient,
addition: Ingredient,
pattern: RecipeTrimPattern,
},
BannerDuplicate {
banner: Ingredient,
result: RecipeTemplate,
},
ShieldDecoration {
banner: Ingredient,
target: Ingredient,
result: RecipeTemplate,
},
Transmute {
input: Ingredient,
material: Ingredient,
min: usize,
max: usize,
add_count: bool,
result: RecipeTemplate,
},
Dye {
target: Ingredient,
dye: Ingredient,
result: RecipeTemplate,
},
Imbue {
source: Ingredient,
material: Ingredient,
result: RecipeTemplate,
},
BookCloning {
source: Ingredient,
material: Ingredient,
min: i32,
max: i32,
result: RecipeTemplate,
},
FireworkRocket {
shell: Ingredient,
fuel: Ingredient,
star: Ingredient,
result: RecipeTemplate,
},
FireworkStar {
dye: Ingredient,
fuel: Ingredient,
trail: Ingredient,
twinkle: Ingredient,
shapes: Vec<FireworkShapeIngredient>,
result: RecipeTemplate,
},
FireworkStarFade {
dye: Ingredient,
target: Ingredient,
result: RecipeTemplate,
},
MapExtending {
map: Ingredient,
material: Ingredient,
result: RecipeTemplate,
},
DecoratedPot {
back: Ingredient,
left: Ingredient,
right: Ingredient,
front: Ingredient,
result: RecipeTemplate,
},
RepairItem,
}Expand description
The parsed rule of a stonecutting, smithing or special crafting recipe.
These are the same resolved ingredients and rules the game uses, not a
second recipe implementation. Only Stonecutting has a fixed output;
every other variant depends on the grid or smithing inputs (components,
counts, dyes, trim material, damage or map state). Special crafting
results are assembled by crate::LevelRef::recipe_for, not by treating the
template as a fixed stack. A mod-defined recipe type keeps its raw JSON
instead of inventing a vanilla rule.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Stonecutting
A stonecutter input and fixed result.
SmithingTransform
Apply a result template over the base item and its components.
Fields
template: Option<Ingredient>Optional template slot; absent requires an empty slot.
base: IngredientBase slot; supplies the output components.
addition: Option<Ingredient>Optional addition slot; absent requires an empty slot.
result: RecipeTemplateResult template applied to inherited components.
SmithingTrim
Apply the pattern using the addition’s trim material to the base.
Fields
template: IngredientTemplate slot.
base: IngredientBase slot; supplies the output item and components.
addition: IngredientAddition slot; selects the trim material.
pattern: RecipeTrimPatternRegistry reference or inline trim pattern.
BannerDuplicate
Copy a patterned banner onto a blank banner of the same colour.
ShieldDecoration
Apply a banner’s patterns to an undecorated shield.
Fields
Banner supplying patterns and colour.
target: IngredientShield to decorate.
result: RecipeTemplateResult template; components come from the grid.
Transmute
One input and a bounded number of materials, retaining input components.
Fields
input: IngredientInput supplying the inherited item and components.
material: IngredientMaterial ingredient.
result: RecipeTemplatePatch applied after the input’s components.
Dye
Dye a target using the grid’s dye colours.
Fields
target: IngredientTarget item.
dye: IngredientDye items.
result: RecipeTemplateTemplate; the resulting colour depends on the grid.
Imbue
Imbue materials with the source’s potion contents.
Fields
source: IngredientSource of potion contents.
material: IngredientMaterial around the source.
result: RecipeTemplateTemplate receiving the potion contents.
BookCloning
Copy a written book within the allowed generation range.
Fields
source: IngredientWritten book supplying contents and generation.
material: IngredientBlank books.
result: RecipeTemplateTemplate; count and book contents depend on the grid.
FireworkRocket
Build rockets with flight duration and explosions from the grid.
Fields
shell: IngredientRocket shell.
fuel: IngredientFuel, whose occupied slots choose flight duration.
star: IngredientOptional stars supplying explosions.
result: RecipeTemplateRocket template.
FireworkStar
Build a star with colours, shape and effects from the grid.
Fields
dye: IngredientColour ingredients.
fuel: IngredientFuel ingredient.
trail: IngredientOptional trail ingredient.
twinkle: IngredientOptional twinkle ingredient.
shapes: Vec<FireworkShapeIngredient>Shape ingredients, in the parsed rule’s order.
result: RecipeTemplateStar template.
FireworkStarFade
Add fade colours to an existing star.
Fields
dye: IngredientFade colour ingredients.
target: IngredientStar whose other explosion properties are retained.
result: RecipeTemplateStar template.
MapExtending
Extend a map when its live map state permits it.
Fields
map: IngredientMap input.
material: IngredientSurrounding material.
result: RecipeTemplateTemplate; map identity and postprocessing depend on the input.
DecoratedPot
Build a pot with decorations from the four sides of the grid.
Fields
back: IngredientBack decoration.
left: IngredientLeft decoration.
right: IngredientRight decoration.
front: IngredientFront decoration.
result: RecipeTemplatePot template.
RepairItem
Repair two damaged items of the same kind; eligibility, damage and retained curses depend on the input stacks, not a fixed ingredient list.
Trait Implementations§
§impl Clone for RecipeRule
impl Clone for RecipeRule
§fn clone(&self) -> RecipeRule
fn clone(&self) -> RecipeRule
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more