pub struct Recipe {
pub id: String,
pub kind: RecipeKind,
pub result: String,
pub count: u32,
pub group: Option<String>,
pub category: Option<String>,
}Expand description
A recipe, in Yog’s own format — what a .yrecipe says. The host writes
the recipe JSON of its Minecraft version from it.
An ingredient is an item id (minecraft:stick), an item tag (#c:dusts)
or — the _any builders — any of several.
Recipe::shaped("yog:ruby_sword", "yog:ruby_sword", 1)
.row(" R ").row(" R ").row(" S ")
.key('R', "yog:ruby").key('S', "minecraft:stick");
Recipe::cooking("yog:ruby", Cooking::Blasting, "#c:ruby_ores", "yog:ruby", 1).experience(0.7);Fields§
§id: String§kind: RecipeKind§result: String§count: u32§group: Option<String>Recipes of a group share a slot in the recipe book.
category: Option<String>The recipe book’s tab (building, equipment, misc, …).
Implementations§
Source§impl Recipe
impl Recipe
pub fn shaped( id: impl Into<String>, result: impl Into<String>, count: u32, ) -> Recipe
pub fn shapeless( id: impl Into<String>, result: impl Into<String>, count: u32, ) -> Recipe
Sourcepub fn cooking(
id: impl Into<String>,
method: Cooking,
ingredient: impl Into<String>,
result: impl Into<String>,
count: u32,
) -> Recipe
pub fn cooking( id: impl Into<String>, method: Cooking, ingredient: impl Into<String>, result: impl Into<String>, count: u32, ) -> Recipe
Cooking ingredient (100 % of a vanilla furnace: 0.1 experience,
200 ticks — see Self::experience, Self::cook_time).
pub fn stonecutting( id: impl Into<String>, ingredient: impl Into<String>, result: impl Into<String>, count: u32, ) -> Recipe
pub fn smithing( id: impl Into<String>, template: impl Into<String>, base: impl Into<String>, addition: impl Into<String>, result: impl Into<String>, ) -> Recipe
Sourcepub fn key(self, symbol: char, item: impl Into<String>) -> Recipe
pub fn key(self, symbol: char, item: impl Into<String>) -> Recipe
What symbol stands for in a shaped recipe.
Sourcepub fn key_any(
self,
symbol: char,
items: impl IntoIterator<Item = impl Into<String>>,
) -> Recipe
pub fn key_any( self, symbol: char, items: impl IntoIterator<Item = impl Into<String>>, ) -> Recipe
symbol stands for any of items.
Sourcepub fn ingredient(self, item: impl Into<String>) -> Recipe
pub fn ingredient(self, item: impl Into<String>) -> Recipe
One more ingredient of a shapeless recipe.
Sourcepub fn ingredient_any(
self,
items: impl IntoIterator<Item = impl Into<String>>,
) -> Recipe
pub fn ingredient_any( self, items: impl IntoIterator<Item = impl Into<String>>, ) -> Recipe
One more ingredient of a shapeless recipe: any of items.
Sourcepub fn experience(self, xp: f32) -> Recipe
pub fn experience(self, xp: f32) -> Recipe
Experience a cooking recipe gives.
pub fn group(self, group: impl Into<String>) -> Recipe
pub fn category(self, category: impl Into<String>) -> Recipe
Trait Implementations§
impl StructuralPartialEq for Recipe
Auto Trait Implementations§
impl Freeze for Recipe
impl RefUnwindSafe for Recipe
impl Send for Recipe
impl Sync for Recipe
impl Unpin for Recipe
impl UnsafeUnpin for Recipe
impl UnwindSafe for Recipe
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