Skip to main content

yog_event/container/
machine.rs

1//! Machines: an inventory's `.yui` `<RecipeArea>` and the recipes its slots make.
2
3use yog_core::BlockPos;
4use yog_data::Schema;
5
6/// A machine and the recipe its slots make. Pre: whether it may — the
7/// result shows only if every handler allows it (a workbench short of a
8/// resource says no); `player` empty. Post: a player took the result — the
9/// mod takes its share (the host takes the ingredients).
10#[derive(Debug, Clone, Schema)]
11pub struct Craft {
12    /// The machine's inventory (`mymod:press`).
13    pub machine: String,
14    /// The recipe's kind and id.
15    pub kind: String,
16    pub recipe: String,
17    pub result_item: String,
18    pub result_count: u32,
19    /// The recipe's values (`{ energy: 4 }`).
20    pub values: yog_data::Value,
21    pub pos: BlockPos,
22    pub dimension: String,
23    /// Who took the result; empty before.
24    pub player: String,
25}