pub struct ShapedRecipe {
pub id: String,
pub height: u8,
pub width: u8,
pub pattern: Vec<String>,
pub keys: Vec<(char, Ingredient)>,
pub result: ItemStack,
}Expand description
A shaped crafting recipe.
Patterns use single-character keys mapped to Ingredient entries.
Spaces represent empty slots.
Fields§
§id: StringUnique recipe identifier (e.g. "pumpkinplus:diamond_horse_armor").
height: u8Grid height (1–3).
width: u8Grid width (1–3).
pattern: Vec<String>Pattern rows. Each string must be exactly width characters.
Use a space ' ' for an empty slot.
keys: Vec<(char, Ingredient)>Mapping from pattern characters to ingredients.
result: ItemStackThe result item.
Trait Implementations§
Source§impl Clone for ShapedRecipe
impl Clone for ShapedRecipe
Source§fn clone(&self) -> ShapedRecipe
fn clone(&self) -> ShapedRecipe
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ShapedRecipe
impl RefUnwindSafe for ShapedRecipe
impl Send for ShapedRecipe
impl Sync for ShapedRecipe
impl Unpin for ShapedRecipe
impl UnsafeUnpin for ShapedRecipe
impl UnwindSafe for ShapedRecipe
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more