pub struct OwnedShapelessRecipe {
pub id: RecipeId,
pub ingredients: Vec<i32>,
pub result_id: i32,
pub result_count: i32,
}Expand description
An owned shapeless crafting recipe for plugin-registered custom recipes.
Unlike the static [basalt_recipes::generated::ShapelessRecipe] which uses
&'static slices, this type owns its ingredient list 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.
ingredients: Vec<i32>Unordered set of required ingredient item state IDs, sorted ascending.
Must be kept sorted for correct matching. Duplicates are allowed.
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 OwnedShapelessRecipe
impl Clone for OwnedShapelessRecipe
Source§fn clone(&self) -> OwnedShapelessRecipe
fn clone(&self) -> OwnedShapelessRecipe
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 OwnedShapelessRecipe
impl Debug for OwnedShapelessRecipe
Source§impl PartialEq for OwnedShapelessRecipe
impl PartialEq for OwnedShapelessRecipe
impl Eq for OwnedShapelessRecipe
impl StructuralPartialEq for OwnedShapelessRecipe
Auto Trait Implementations§
impl Freeze for OwnedShapelessRecipe
impl RefUnwindSafe for OwnedShapelessRecipe
impl Send for OwnedShapelessRecipe
impl Sync for OwnedShapelessRecipe
impl Unpin for OwnedShapelessRecipe
impl UnsafeUnpin for OwnedShapelessRecipe
impl UnwindSafe for OwnedShapelessRecipe
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.