pub struct OwnedShapedRecipe {
pub id: RecipeId,
pub width: u8,
pub height: u8,
pub pattern: Vec<Option<i32>>,
pub result_id: i32,
pub result_count: i32,
}Expand description
An owned shaped crafting recipe for plugin-registered custom recipes.
Unlike the static [basalt_recipes::generated::ShapedRecipe] which uses
&'static slices, this type owns its pattern data on the heap.
The result_count is i32 (not u8) for flexibility in plugin recipes.
Fields§
§id: RecipeIdStable identifier — must be unique across the registry.
width: u8Grid width (1-3 for standard crafting table recipes).
height: u8Grid height (1-3 for standard crafting table recipes).
pattern: Vec<Option<i32>>Flat grid of ingredient item IDs in row-major order.
Length must equal width * height. None means the slot must be
empty; Some(id) means the slot requires that item state ID.
result_id: i32The item state ID of the crafted result.
result_count: i32How many items are produced per craft.
Trait Implementations§
Source§impl Clone for OwnedShapedRecipe
impl Clone for OwnedShapedRecipe
Source§fn clone(&self) -> OwnedShapedRecipe
fn clone(&self) -> OwnedShapedRecipe
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 moreSource§impl Debug for OwnedShapedRecipe
impl Debug for OwnedShapedRecipe
Source§impl PartialEq for OwnedShapedRecipe
impl PartialEq for OwnedShapedRecipe
impl Eq for OwnedShapedRecipe
impl StructuralPartialEq for OwnedShapedRecipe
Auto Trait Implementations§
impl Freeze for OwnedShapedRecipe
impl RefUnwindSafe for OwnedShapedRecipe
impl Send for OwnedShapedRecipe
impl Sync for OwnedShapedRecipe
impl Unpin for OwnedShapedRecipe
impl UnsafeUnpin for OwnedShapedRecipe
impl UnwindSafe for OwnedShapedRecipe
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.