pub enum BookPage {
Text {
text: String,
title: Option<String>,
},
Spotlight {
item: ItemDef,
title: Option<String>,
text: Option<String>,
},
Crafting {
recipe_id: String,
text: Option<String>,
},
Smelting {
recipe_id: String,
text: Option<String>,
},
Image {
texture: String,
title: Option<String>,
text: Option<String>,
border: bool,
},
Entity {
entity_type: String,
name: Option<String>,
text: Option<String>,
},
Relations {
entries: Vec<String>,
text: Option<String>,
},
Empty,
Pattern {
op_id: String,
anchor: String,
input: String,
output: String,
text: String,
},
Svg {
data: String,
title: Option<String>,
text: Option<String>,
},
CustomText {
text: String,
font: BookFont,
color: u32,
},
}Expand description
A single page variant inside a book entry.
The wire format (mod ↔ runtime JSON boundary, produced by
BookPage::to_json) is internally tagged with snake_case names —
{"type": "spotlight", "item": "yog:ruby", ...} — like Patchouli’s
per-page “type” field. The serde attributes below keep Deserialize
in exact agreement with to_json.
Variants§
Text
Plain formatted text, optionally with a section title (for non-first pages).
Spotlight
Display an item outlined (tooltip on hover).
Fields
Crafting
Crafting recipe display (autorenders 3×3 grid).
Smelting
Smelting recipe display.
Image
Image overlay page.
Entity
Entity display page (renders a living entity in a box).
Relations
Link to another entry (like Patchouli’s relations).
Empty
Empty separator.
Pattern
Custom pattern page for Hexcasting-style mods (like hexcasting:pattern).
Svg
SVG image page — rasterized at render time via resvg.
CustomText
Text rendered with a custom TTF/OTF font.