yog_event/item.rs
1//! Items' services: what a mod says about its items' stacks.
2
3use yog_data::Schema;
4
5/// A stack's own name and tooltip, from its custom data (a written
6/// blueprint shows its design) — keyed by the item, answered by its mod;
7/// `None`: the item's own.
8#[derive(Debug, Clone, Schema)]
9pub struct Text {
10 pub item: String,
11 /// The stack's custom data, as SNBT.
12 pub snbt: String,
13}
14
15/// What a stack shows instead of its item's own name and description.
16#[derive(Debug, Clone, PartialEq, Schema)]
17pub struct Shown {
18 /// Its name; `None`: the item's own.
19 pub name: Option<String>,
20 /// The tooltip lines that stand instead of its description.
21 pub lines: Vec<String>,
22}
23
24/// Whether a stack gets a picture under its tooltip (Hex Casting's scrolls
25/// show their pattern), and its size in GUI pixels — keyed by the item,
26/// answered by its mod; drawn on `client::render::Tooltip`.
27#[derive(Debug, Clone, Schema)]
28pub struct Picture {
29 pub item: String,
30 /// The stack's custom data, as SNBT.
31 pub snbt: String,
32}
33
34mod actions;
35pub use actions::*;