Skip to main content

Crate yog_cli

Crate yog_cli 

Source
Expand description

The yog CLI’s internals: yog.toml parsing, the generated .yog-build/ workspace, .yres resources, content/ blocks and items, .yui screens and #[yog_export] crates.

Not for external use — a library only so the yog binary, its tests and its benches share the code. No API stability, not published separately.

Modules§

bench
yog bench — a mod’s benchmarks: benches/*.rs files whose #[yog_api::bench] functions run under criterion.
book_page
A mod’s own kinds of book page: .yui components with book_page, compiled into yog_formats::book::page_type::PageTypes for the books that use them (see that module).
cargo_toml
The generated .yog-build/Cargo.toml.
content
.yblock / .yitem content files — a mod’s blocks and items: their properties, 3D model, block states and item form, in one JSON file each, edited in Yog-IDLE’s 3D model editor — and .yrecipe files, one recipe each (crafting, shapeless, smelting), edited in its recipe editor. See Yog-IDLE’s docs/blocks-items.md for the formats.
design
The .yui screen designer’s backend: the canvas drawn by yog-ui itself (the crate mods render with in game) through a recording YogGfxApi, rasterized with Minecraft’s own font and textures from the local game files; a preview mode driving the same tree with real UI events (click:X:Y, scroll:DY, scrollbar drags); and code-behind handlers.
exports
yog publish exports — the -exports crate generated from a mod’s #[yog_export] items.
manifest
yog.toml — a mod project’s manifest, the only build file mod authors write.
media
A mod’s media as the tools see them: its .yres pictures (bytes and all), its .ytextures, and the files the build makes of them — so the IDE previews and edits what the build will make, converting nothing itself. Reading is cached until a file changes.
recipe_area
<RecipeArea kind="crusher" x="…" y="…"/> in an inventory screen: the kind’s layout (its .yui recipe_layout, see yog_formats::book::layout) made real — its places become the container’s slots (numbered after the screen’s own), its result an output slot, its pictures and stations drawn — and a <Machine> that tells the game which slot is which: the block makes recipes of the kind like a crafting table.
serve
yog serve — the CLI as a service for tools (Yog-IDLE): one JSON request per line on stdin, one reply per line on stdout. Every format is read, written and converted here, so a tool needn’t be rebuilt when a format changes — only this binary.
yres
.yres resource files — a mod’s texts, images, sounds, files, colors, numbers and flags, like a C# project’s Resources/*.resx. See Yog-IDLE’s docs/yres.md for the format.
yui
.yui screen files — the declarative form of a yog-ui widget tree that Yog-IDLE’s screen designer edits — and their code generation.
yui_component
Component .yui files: a <Component> root declaring properties and events, with one body element bound to them through {x:Bind ...} (the same bindings as view-model screens, [crate::yui_vm::compile_bind]). Generates a struct with one typed field per property and its yog_api::ui::component::Component implementation, registered with ui_component!. See Yog-IDLE’s docs/yui.md, “Components”.
yui_grid
<Grid> in .yui — WPF’s Grid: rows and columns, children placed in cells with attached Grid.Row / Grid.Column / Grid.RowSpan / Grid.ColumnSpan.
yui_vm
View-model screens: a .yui whose <Screen> has x:ViewModel="MyVm" compiles into a yog_kit::View — the static widget tree (built by crate::yui’s generator), compiled {x:Bind ...} bindings patching it, commands, two-way text boxes and toggles, lists with item templates, and the register/open/close functions. See docs/mvvm.md in Yog-IDLE for the format.