Skip to main content

content

Macro content 

Source
macro_rules! content {
    () => { ... };
}
Expand description

Pulls the mod’s blocks and items — content/**/*.yblock and *.yitem, made in Yog-IDLE’s model editor — in as module content, and registers them (every file without "register": "manual") right after Mod::register:

ⓘ
// src/lib.rs — that's all it takes
yog_api::content!();

// Ids and definitions, for code that needs them:
use crate::content::{Blocks, Items};
let id: &str = Blocks::RUBY_ORE;                 // "mymod:ruby_ore"
registry.register_item(Items::ruby().max_stack(16)); // a "manual" one, tweaked

yog build, yog check and yog content check generate .yog-build/generated/yog-content.g.rs — never committed, never stale. The models, blockstates, loot tables, tags and lang entries go into the .yog as assets. See Yog-IDLE’s docs/blocks-items.md.