first commit
This commit is contained in:
commit
41d8c71c65
32 files changed
+6765
No files matched your search
@@ -0,0 +1,67 @@
|
||||
interface recipe {
|
||||
use item-stack.{item-stack};
|
||||
|
||||
/// Represents an ingredient in a recipe.
|
||||
variant ingredient {
|
||||
/// A specific item.
|
||||
item(string),
|
||||
/// A tag group of items (e.g., "minecraft:logs").
|
||||
tag(string),
|
||||
}
|
||||
|
||||
/// Represents a shaped crafting recipe.
|
||||
record shaped-recipe {
|
||||
/// The pattern of the recipe (e.g., ["# #", " s ", "# #"]).
|
||||
pattern: list<string>,
|
||||
/// Mapping of characters in the pattern to ingredients.
|
||||
key: list<tuple<string, ingredient>>,
|
||||
/// The resulting item stack.
|
||||
output: item-stack,
|
||||
/// The recipe group (optional).
|
||||
group: option<string>,
|
||||
}
|
||||
|
||||
/// Represents a shapeless crafting recipe.
|
||||
record shapeless-recipe {
|
||||
/// The list of ingredients required.
|
||||
ingredients: list<ingredient>,
|
||||
/// The resulting item stack.
|
||||
output: item-stack,
|
||||
/// The recipe group (optional).
|
||||
group: option<string>,
|
||||
}
|
||||
|
||||
/// Represents a cooking recipe (Smelting, Blasting, Smoking, Campfire).
|
||||
record cooking-recipe {
|
||||
/// The ingredient to cook.
|
||||
ingredient: ingredient,
|
||||
/// The resulting item stack.
|
||||
output: item-stack,
|
||||
/// Experience points awarded.
|
||||
experience: f32,
|
||||
/// Cooking time in ticks.
|
||||
cooking-time: u32,
|
||||
/// The recipe group (optional).
|
||||
group: option<string>,
|
||||
}
|
||||
|
||||
/// Types of cooking stations.
|
||||
enum cooking-type {
|
||||
smelting,
|
||||
blasting,
|
||||
smoking,
|
||||
campfire,
|
||||
}
|
||||
|
||||
/// Common interface for registering recipes.
|
||||
resource recipe-manager {
|
||||
/// Registers a shaped crafting recipe.
|
||||
register-shaped: func(id: string, recipe: shaped-recipe);
|
||||
|
||||
/// Registers a shapeless crafting recipe.
|
||||
register-shapeless: func(id: string, recipe: shapeless-recipe);
|
||||
|
||||
/// Registers a cooking recipe.
|
||||
register-cooking: func(id: string, station-type: cooking-type, recipe: cooking-recipe);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user