Başvuru
Bu sayfa İngilizce gösteriliyor.
recipe
Recipe definitions and registration functions.
Declarations from the script contract strawberry:plugin, version 0.2.0, without source comments.
WIT declarations
use item-stack.{item-stack};
enum recipe-category {
building,
redstone,
equipment,
misc,
food,
blocks,
}
variant ingredient {
item(string),
tag(string),
one-of(list<string>),
}
record shaped-recipe {
pattern: list<string>,
key: list<tuple<string, ingredient>>,
output: item-stack,
group: option<string>,
category: option<recipe-category>,
show-notification: option<bool>,
}
record shapeless-recipe {
ingredients: list<ingredient>,
output: item-stack,
group: option<string>,
category: option<recipe-category>,
}
record cooking-recipe {
ingredient: ingredient,
output: item-stack,
experience: f32,
cooking-time: u32,
group: option<string>,
category: option<recipe-category>,
}
record exact-cooking-recipe {
inputs: list<item-stack>,
output: item-stack,
experience: f32,
cooking-time: u32,
group: option<string>,
category: option<recipe-category>,
}
variant exact-ingredient {
plain(ingredient),
exact(list<item-stack>),
}
record exact-shaped-recipe {
pattern: list<string>,
key: list<tuple<string, exact-ingredient>>,
output: item-stack,
group: option<string>,
category: option<recipe-category>,
show-notification: option<bool>,
}
record exact-shapeless-recipe {
ingredients: list<exact-ingredient>,
output: item-stack,
group: option<string>,
category: option<recipe-category>,
}
record exact-smithing-recipe {
template: option<exact-ingredient>,
base: exact-ingredient,
addition: option<exact-ingredient>,
output: item-stack,
copy-base-components: option<bool>,
}
record exact-smithing-trim-recipe {
template: exact-ingredient,
base: exact-ingredient,
addition: exact-ingredient,
pattern: string,
}
record exact-stonecutting-recipe {
input: exact-ingredient,
output: item-stack,
group: option<string>,
}
enum cooking-type {
smelting,
blasting,
smoking,
campfire,
}
enum recipe-kind {
shaped,
shapeless,
transmute,
smelting,
blasting,
smoking,
campfire,
stonecutting,
smithing-transform,
}
record cooking-info {
experience: f32,
cooking-time: u32,
}
record recipe-info {
id: string,
kind: recipe-kind,
pattern: list<string>,
key: list<tuple<string, ingredient>>,
ingredients: list<ingredient>,
output: item-stack,
group: option<string>,
category: option<recipe-category>,
cooking: option<cooking-info>,
}
record recipe-page {
recipes: list<recipe-info>,
total: u32,
}
resource recipe-manager {
register-shaped: func(id: string, recipe: shaped-recipe);
register-shapeless: func(id: string, recipe: shapeless-recipe);
register-cooking: func(id: string, station-type: cooking-type, recipe: cooking-recipe);
register-cooking-exact: func(id: string, station-type: cooking-type, recipe: exact-cooking-recipe);
register-shaped-exact: func(id: string, recipe: exact-shaped-recipe);
register-shapeless-exact: func(id: string, recipe: exact-shapeless-recipe);
register-smithing-exact: func(id: string, recipe: exact-smithing-recipe) -> result<_, string>;
register-smithing-trim: func(id: string, recipe: exact-smithing-trim-recipe) -> result<_, string>;
register-stonecutting-exact: func(id: string, recipe: exact-stonecutting-recipe) -> result<_, string>;
remove-recipe: func(id: string) -> result<bool, string>;
recipes-for: func(item: string, start: u32) -> recipe-page;
get-recipe: func(id: string) -> option<recipe-info>;
}