pub enum CraftingRecipe {
Shaped(&'static ShapedRecipe),
Shapeless(&'static ShapelessRecipe),
}Expand description
Unified crafting recipe enum (replaces trait-based approach).
Variants§
Shaped(&'static ShapedRecipe)
Shapeless(&'static ShapelessRecipe)
Implementations§
Source§impl CraftingRecipe
impl CraftingRecipe
Sourcepub fn id(&self) -> &Identifier
pub fn id(&self) -> &Identifier
Returns the recipe identifier.
Sourcepub fn category(&self) -> CraftingCategory
pub fn category(&self) -> CraftingCategory
Returns the recipe category.
Sourcepub fn result(&self) -> &RecipeResult
pub fn result(&self) -> &RecipeResult
Returns the result of this recipe.
Sourcepub fn matches(&self, input: &CraftingInput) -> bool
pub fn matches(&self, input: &CraftingInput) -> bool
Tests if the crafting input matches this recipe. The input should already be positioned/trimmed.
Sourcepub fn get_remaining_items(&self, input: &CraftingInput) -> Vec<ItemStack>
pub fn get_remaining_items(&self, input: &CraftingInput) -> Vec<ItemStack>
Gets the remaining items after crafting (e.g., empty buckets).
Sourcepub fn fits_in_2x2(&self) -> bool
pub fn fits_in_2x2(&self) -> bool
Returns true if this recipe fits in a 2x2 grid.
Trait Implementations§
Source§impl Clone for CraftingRecipe
impl Clone for CraftingRecipe
Source§fn clone(&self) -> CraftingRecipe
fn clone(&self) -> CraftingRecipe
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for CraftingRecipe
Source§impl Debug for CraftingRecipe
impl Debug for CraftingRecipe
Auto Trait Implementations§
impl Freeze for CraftingRecipe
impl RefUnwindSafe for CraftingRecipe
impl Send for CraftingRecipe
impl Sync for CraftingRecipe
impl Unpin for CraftingRecipe
impl UnsafeUnpin for CraftingRecipe
impl UnwindSafe for CraftingRecipe
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