Skip to main content

yog_ids/names/
content.rs

1//! Resources, files and content: where things live and what they're called.
2
3names! {
4
5    /// A `.yres` entry's type (`{ "type": "sound", ... }`).
6    res_kind {
7        STRING = crate::word::STRING,
8        IMAGE = crate::typed::IMAGE,
9        FILE = crate::word::FILE,
10        SOUND = crate::word::SOUND,
11        COLOR = crate::word::COLOR,
12        NUMBER = crate::word::NUMBER,
13        BOOL = crate::word::BOOL,
14        VIDEO = crate::word::VIDEO,
15    }
16
17    /// What an image source starts with (`item:apple`).
18    image_scheme {
19        ITEM = crate::kind::ITEM,
20        BLOCK = crate::kind::BLOCK,
21        SPRITE = crate::word::SPRITE,
22        MOD = crate::word::MOD,
23        VIDEO = crate::kind::VIDEO,
24    }
25
26    /// Yog's files with a fixed name.
27    file {
28        /// A mod's manifest.
29        MANIFEST = crate::concatcp!(crate::ns::YOG, crate::sep::DOT, "toml"),
30        /// The versions a mod's build resolved.
31        LOCK = crate::concatcp!(crate::ns::YOG, crate::sep::DOT, "lock"),
32    }
33
34    /// What a built `.yog` holds besides the mod's files.
35    archive {
36        /// What it says about its mod (`yog_formats::manifest::Built`, Yog Data).
37        MANIFEST = crate::concatcp!(crate::word::MOD, crate::sep::DOT, crate::Format::Data.ext()),
38        /// Its native libraries, one folder per platform: `natives/linux-x86_64/libmymod.so`.
39        NATIVES = "natives",
40    }
41
42    /// A picture of few colors as a `.yog` keeps it (`yog_media::yimage`):
43    /// under its `.png` name, told apart by these first bytes; the host
44    /// hands the game its PNG, made in memory.
45    yimage {
46        MAGIC = "YIMG",
47    }
48
49    /// A release's debug info, split from its natives: one folder per
50    /// platform (`symbols/linux-x86_64/libmymod.so.debug`), read beside the
51    /// stripped native or from Yog Installer's symbols component.
52    symbols {
53        DIR = "symbols",
54        /// What a native's split debug info adds to its file name.
55        EXT = "debug",
56    }
57
58    /// The pack the build writes for the hosts.
59    pack {
60        /// The game's data: `data/<ns>/…`.
61        DATA = crate::word::DATA,
62        /// The game's assets: `assets/<ns>/…`.
63        ASSETS = "assets",
64        /// Tags, under a namespace's data: `data/<ns>/tags/<registry>/<path>.json`.
65        TAGS = "tags",
66        /// Worldgen, under a namespace's data: `data/<ns>/worldgen/<registry>/<path>.json`.
67        WORLDGEN = "worldgen",
68        /// Overlays for one loader and version: `when/<loader>/<version>/<file>`.
69        OVERLAYS = crate::word::WHEN,
70        /// An overlay's loader when it's for every loader.
71        ANY_LOADER = crate::word::ANY,
72        /// An overlay's version when it's for every version.
73        ANY_VERSION = crate::word::ANY,
74    }
75
76    /// A mod project's folders.
77    project {
78        /// Its resources: `.yres` sets, `.ytexture`s, ….
79        RESOURCES = "resources",
80        /// Its content: blocks, items, recipes, books, definitions.
81        CONTENT = crate::word::CONTENT,
82        /// Where a copy of a game font goes, under its content.
83        FONT_COPIES = crate::kind::FONT,
84        /// Its code and screens.
85        SRC = crate::word::SRC,
86        /// What `yog build` makes on the way (as .NET's `obj/`): the generated
87        /// crate, generated code, exports crates, cargo's `target/`.
88        OBJ = "obj",
89        /// Cargo's build output, under `obj/`.
90        TARGET = crate::concatcp!(crate::project::OBJ, crate::sep::PATH, crate::word::TARGET),
91        /// The code and data the build generates, under `obj/`.
92        GENERATED = crate::concatcp!(crate::project::OBJ, crate::sep::PATH, "generated"),
93        /// What `yog build` makes (as .NET's `bin/`): the `.yog`, one a
94        /// platform, split debug info.
95        BIN = "bin",
96    }
97
98    /// A game's folders Yog uses.
99    game_dir {
100        /// The `.yog` mods the game loads: `<game>/yog-mods`.
101        MODS = crate::concatcp!(crate::ns::YOG, crate::sep::HYPHEN, crate::word::MODS),
102    }
103
104
105    /// Yog's programs.
106    program {
107        /// The command-line tool (`yog build`, `yog schema`, …).
108        CLI = crate::ns::YOG,
109        /// The CLI's service command: tools read and write every format through it.
110        SERVE = "serve",
111        /// Yog Script's tool (`yog-script check`, `yog-script index`), installed
112        /// as its own component; the CLI compiles a mod's scripts through
113        /// `yog-script-build` itself.
114        SCRIPT = "yog-script",
115    }
116
117    /// The structs the generated code names a mod's content by
118    /// (`Items::RUBY`); a `.yres` set of the same name holds that content's
119    /// names (`Items.yres`: `item.<mod>.<name>`).
120    code_set {
121        BLOCKS = "Blocks",
122        ITEMS = "Items",
123        ENTITIES = "Entities",
124        ADVANCEMENTS = "Advancements",
125        MODELS = "Models",
126        ANIMS = "Anims",
127        TEXTURES = "Textures",
128    }
129
130    /// Yog's crates a mod's code builds with, as Cargo names them (Rust's
131    /// name has `_` for `-`: [`crate::rust_name`]).
132    rust_crate {
133        /// What every one of Yog's crates is named with.
134        PREFIX = crate::concatcp!(crate::ns::YOG, crate::sep::HYPHEN),
135        /// The API crate: its word, its name, its name in Rust code, and the
136        /// `[dependencies]` key that pins its version alone.
137        API_WORD = "api",
138        API = crate::concatcp!(PREFIX, API_WORD),
139        API_RUST_NAME = crate::concatcp!(crate::ns::YOG, crate::sep::WORD, API_WORD),
140        API_VERSION_KEY = crate::concatcp!(API_RUST_NAME, crate::sep::WORD, crate::serve_method::VERSION),
141        ABI = crate::concatcp!(PREFIX, "abi"),
142        UI = crate::concatcp!(PREFIX, crate::word::UI),
143        KIT = crate::concatcp!(PREFIX, "kit"),
144        GFX = crate::concatcp!(PREFIX, "gfx"),
145        REGISTRY = crate::concatcp!(PREFIX, crate::serve_param::REGISTRY),
146        /// The data crate: its name, and its name in Rust code (yog-api's module of it too).
147        DATA = crate::concatcp!(PREFIX, crate::word::DATA),
148        DATA_RUST_NAME = crate::concatcp!(crate::ns::YOG, crate::sep::WORD, crate::word::DATA),
149    }
150
151    /// Where the game keeps resources, and what their files end with.
152    res {
153        /// The textures' folder: `<ns>:textures/<path>.png`.
154        TEXTURES = crate::concatcp!(crate::model::TEXTURES, crate::sep::PATH),
155        /// The models' folder: `<ns>:models/<path>.json`.
156        MODELS = crate::concatcp!(crate::word::MODELS, crate::sep::PATH),
157        /// The block states' folder: `<ns>:blockstates/<path>.json`.
158        BLOCKSTATES = crate::concatcp!("blockstates", crate::sep::PATH),
159        /// Items' textures and models: `item/apple`.
160        ITEM_DIR = crate::concatcp!(crate::kind::ITEM, crate::sep::PATH),
161        /// Item definitions (1.21.4+): `<ns>:items/<path>.json`.
162        ITEM_DEFINITIONS = crate::concatcp!(crate::word::ITEMS, crate::sep::PATH),
163        /// Equipment's worn looks (1.21.4+): `<ns>:equipment/<path>.json`.
164        EQUIPMENT = crate::concatcp!(crate::word::EQUIPMENT, crate::sep::PATH),
165        /// Worn equipment's textures (1.21.4+): `entity/equipment/<layer>/<path>`.
166        EQUIPMENT_TEXTURES = crate::concatcp!(crate::kind::ENTITY, crate::sep::PATH, crate::word::EQUIPMENT, crate::sep::PATH),
167        /// Armor's worn textures before 1.21.4: `models/armor/<path>_layer_<n>`.
168        ARMOR_TEXTURES = crate::concatcp!(crate::word::MODELS, crate::sep::PATH, crate::word::ARMOR, crate::sep::PATH),
169        /// Between an armor texture's name and its layer's number.
170        ARMOR_LAYER = "_layer_",
171        /// What a spawn egg's item path ends with: `<mob>_spawn_egg`.
172        SPAWN_EGG_SUFFIX = crate::concatcp!(crate::sep::WORD, crate::word::SPAWN_EGG),
173        /// Blocks' textures and models: `block/stone`.
174        BLOCK_DIR = crate::concatcp!(crate::kind::BLOCK, crate::sep::PATH),
175        /// The GUI atlas's sprites under `textures/` (1.20.2+).
176        GUI_SPRITES = crate::concatcp!(crate::word::GUI, crate::sep::PATH, "sprites", crate::sep::PATH),
177        /// The atlases' definitions: `<ns>:atlases/<atlas>.json` (every pack's sources combine).
178        ATLASES = crate::concatcp!("atlases", crate::sep::PATH),
179        /// The language files' folder: `<ns>:lang/<locale>.json`.
180        LANG = crate::concatcp!(crate::typed::LANG, crate::sep::PATH),
181        /// Models the game draws in code (`builtin/entity`), not from elements.
182        BUILTIN = crate::concatcp!("builtin", crate::sep::PATH),
183        /// Sounds: `<ns>:sounds/<path>.ogg`, their events in `<ns>:sounds.json`.
184        SOUNDS = crate::concatcp!(SOUNDS_WORD, crate::sep::PATH),
185        SOUNDS_JSON = crate::concatcp!(SOUNDS_WORD, JSON),
186        SOUNDS_WORD = "sounds",
187        /// Particles' pictures: `<ns>:particles/<name>.json`.
188        PARTICLES = crate::concatcp!("particles", crate::sep::PATH),
189        OGG = ".ogg",
190        PNG = crate::concatcp!(crate::sep::DOT, crate::word::PNG),
191        SVG = ".svg",
192        JSON = ".json",
193        MCMETA = ".mcmeta",
194    }
195
196    /// Yog's own ids.
197    yog {
198        /// An entity's data the hosts keep for the mods.
199        STATE = crate::id!(crate::ns::YOG, crate::word::STATE),
200        /// A hanging entity's attachment (its face, size, item).
201        HANGING = crate::id!(crate::ns::YOG, "hanging"),
202        /// The key an entity's data is saved under in its NBT.
203        ENTITY_NBT = crate::id!(crate::ns::YOG, crate::word::DATA),
204        /// The channel entity data is synced on.
205        ENTITY_DATA = crate::id!(crate::ns::YOG, crate::concatcp!(crate::kind::ENTITY, crate::sep::WORD, crate::word::DATA)),
206        /// The entity data key an entity's own hitbox travels under: width,
207        /// height, eye height as three little-endian f32.
208        DIMENSIONS = crate::id!(crate::ns::YOG, "dimensions"),
209        /// An inventory slot widget's id: `yog:slot:<index>`.
210        SLOT_PREFIX = crate::id!(crate::ns::YOG, "slot:"),
211        /// The player's inventory widget.
212        PLAYER_INVENTORY = crate::id!(crate::ns::YOG, crate::concatcp!(crate::word::PLAYER, crate::sep::WORD, crate::kind::INVENTORY)),
213        /// A machine screen's id: `yog:machine:<id>`.
214        MACHINE_PREFIX = crate::id!(crate::ns::YOG, "machine:"),
215        /// Yog's alias of a game potion: `yog:potion/<name>`.
216        POTION_ALIAS = crate::id!(crate::ns::YOG, "potion/"),
217        /// Yog's alias of a game font, `yog:font/<name>` — the only way
218        /// anything names one of the game's fonts.
219        FONT_ALIAS = crate::id!(crate::ns::YOG, "font/"),
220        /// The font text is drawn in by default (the game's).
221        DEFAULT_FONT = crate::concatcp!(FONT_ALIAS, crate::game_font::DEFAULT),
222        /// The model every mod's spawn egg inherits: Yog's egg in two layers, base and spots.
223        SPAWN_EGG_MODEL = crate::id!(crate::ns::YOG, crate::concatcp!(crate::res::ITEM_DIR, crate::word::SPAWN_EGG)),
224        /// The book's pictures.
225        BOOK_SHEET = crate::concatcp!(BOOK_TEXTURE, crate::sep::PATH, crate::kind::BOOK),
226        CRAFTING_SHEET = crate::concatcp!(BOOK_TEXTURE, crate::sep::PATH, "crafting"),
227        /// A screen being designed in the IDE.
228        DESIGNER_SCREEN = crate::id!(crate::ns::YOG, "designer"),
229        /// The screen a cutscene plays in (the runtime's own).
230        CUTSCENE_SCREEN = crate::id!(crate::ns::YOG, crate::word::CUTSCENE),
231        /// A book's default texture (its sheet is [`BOOK_SHEET`]).
232        BOOK_TEXTURE = crate::id!(crate::ns::YOG, crate::concatcp!(crate::word::GUI, crate::sep::PATH, crate::kind::BOOK)),
233        /// The textures the runtime renders SVG images into: `<prefix><key>_<w>x<h>`.
234        DYNAMIC_SVG_PREFIX = crate::id!(crate::ns::YOG, crate::concatcp!(crate::word::DYNAMIC, crate::sep::PATH, "svg", crate::sep::WORD)),
235        /// The textures the runtime shows videos' frames in:
236        /// `<prefix><player>.png`, a texture's full id (an image source as it is).
237        DYNAMIC_VIDEO_PREFIX = crate::id!(crate::ns::YOG, crate::concatcp!(crate::res::TEXTURES, crate::word::DYNAMIC, crate::sep::PATH, crate::word::VIDEO, crate::sep::WORD)),
238        /// The textures the runtime draws text in Yog's fonts into: `<prefix><n>`.
239        DYNAMIC_TEXT_PREFIX = crate::id!(crate::ns::YOG, crate::concatcp!(crate::word::DYNAMIC, crate::sep::PATH, crate::word::TEXT, crate::sep::WORD)),
240    }
241
242    /// The game's fonts, by name: Yog aliases each as
243    /// `yog:font/<name>` ([`crate::yog::FONT_ALIAS`]).
244    game_font {
245        DEFAULT = crate::word::DEFAULT,
246        /// Unifont.
247        UNIFORM = "uniform",
248        /// The enchanting table's.
249        ALT = "alt",
250        ILLAGERALT = "illageralt",
251    }
252
253    /// The game's attributes by name — the hosts find each on every
254    /// version (`max_health`, `generic.max_health` before 1.21.2).
255    attribute {
256        MAX_HEALTH = "max_health",
257    }
258
259    /// The game's modes a player is put in.
260    gamemode {
261        SURVIVAL = "survival",
262        CREATIVE = "creative",
263        ADVENTURE = "adventure",
264        SPECTATOR = "spectator",
265    }
266
267    /// The game's ids Yog's code names.
268    game {
269        /// The game's own id of its default font (hosts only; everything
270        /// else says [`crate::yog::DEFAULT_FONT`]).
271        DEFAULT_FONT = crate::id!(crate::ns::MINECRAFT, crate::game_font::DEFAULT),
272        /// The UI theme drawn like the game's own screens.
273        VANILLA_THEME = crate::id!(crate::ns::MINECRAFT, "vanilla"),
274        OVERWORLD = crate::id!(crate::ns::MINECRAFT, "overworld"),
275        /// The empty block: what's left where a block is removed.
276        AIR = crate::id!(crate::ns::MINECRAFT, crate::word::AIR),
277        /// The player entity's type.
278        PLAYER = crate::id!(crate::ns::MINECRAFT, crate::word::PLAYER),
279        /// The sound event that plays nothing: a block or item without a sound of its own.
280        NO_SOUND = crate::id!(crate::ns::MINECRAFT, "intentionally_empty"),
281        /// The biome a dimension is all of when it doesn't say.
282        PLAINS = crate::id!(crate::ns::MINECRAFT, "plains"),
283        THE_NETHER = crate::id!(crate::ns::MINECRAFT, "the_nether"),
284        THE_END = crate::id!(crate::ns::MINECRAFT, "the_end"),
285        /// The block tags of what each kind of tool mines: `<MINEABLE><kind>`.
286        MINEABLE = crate::id!(crate::ns::MINECRAFT, "mineable/"),
287        /// The texture the game draws where one is missing.
288        MISSING_TEXTURE = crate::id!(crate::ns::MINECRAFT, "missingno"),
289        /// What a book is given to players as.
290        WRITTEN_BOOK = crate::id!(crate::ns::MINECRAFT, "written_book"),
291        BOOK = crate::id!(crate::ns::MINECRAFT, crate::kind::BOOK),
292        /// What the game's attributes were named under before 1.21.2: `generic.max_health`.
293        OLD_ATTRIBUTE_PREFIX = crate::concatcp!(crate::word::GENERIC, crate::sep::DOT),
294        /// The language every lang file falls back to, and a mod's texts are written in.
295        LOCALE = "en_us",
296    }
297
298
299    /// The kinds of shape a schema describes itself with
300    /// (`yog_data::Shape::describe`, read by the IDE's property grids).
301    shape_kind {
302        ANY = crate::word::ANY,
303        BOOL = crate::word::BOOL,
304        INT = crate::word::INT,
305        FLOAT = "float",
306        STRING = crate::word::STRING,
307        ATOM = "atom",
308        TEXT = crate::word::TEXT,
309        IMAGE = crate::word::IMAGE,
310        COLOR = crate::word::COLOR,
311        BYTES = crate::word::BYTES,
312        RES = "res",
313        REF = "ref",
314        TAG = crate::kind::TAG,
315        REF_OR_TAG = "ref_or_tag",
316        REF_OR_IMAGE = "ref_or_image",
317        LIST = "list",
318        MAP = "map",
319        OPTIONAL = crate::word::OPTIONAL,
320        STRUCT = "struct",
321        ENUM = "enum",
322        /// A struct or enum written once in `defs`, referred to by name.
323        DEF = "def",
324    }
325
326    /// The elements of a `.yui` screen or component.
327    yui {
328        SCREEN = "Screen",
329        COMPONENT = "Component",
330        /// A component's declarations.
331        PROPERTY = "Property",
332        EVENT = "Event",
333        STYLE = "Style",
334        CANVAS = "Canvas",
335        COLUMN = "Column",
336        ROW = "Row",
337        GRID = "Grid",
338        /// A `<Grid>`'s row and column with limits, and the property elements
339        /// that hold them, as WPF writes them.
340        ROW_DEFINITION = "RowDefinition",
341        COLUMN_DEFINITION = "ColumnDefinition",
342        ROW_DEFINITIONS = crate::concatcp!(GRID, crate::sep::DOT, ROW_DEFINITION, crate::data_layout::PLURAL),
343        COLUMN_DEFINITIONS = crate::concatcp!(GRID, crate::sep::DOT, COLUMN_DEFINITION, crate::data_layout::PLURAL),
344        SCROLL_VIEW = "ScrollView",
345        LABEL = "Label",
346        BUTTON = "Button",
347        TOGGLE_BUTTON = "ToggleButton",
348        TEXT_BOX = "TextBox",
349        IMAGE = "Image",
350        VIDEO = "Video",
351        SURFACE = "Surface",
352        SPACER = "Spacer",
353        STAT_BAR = "StatBar",
354        LIST_VIEW = "ListView",
355        ITEMS_CONTROL = "ItemsControl",
356        CONTENT_PRESENTER = "ContentPresenter",
357        /// Slots: an item shown, an inventory's, the container's.
358        ITEM_SLOT = "ItemSlot",
359        INV_SLOT = "InvSlot",
360        SLOT = "Slot",
361        PLAYER_INVENTORY = "PlayerInventory",
362        /// Which container slot is which, for a block that makes recipes.
363        MACHINE = "Machine",
364        /// A kind of recipe's layout on an inventory screen.
365        RECIPE_AREA = "RecipeArea",
366        /// A recipe layout's places.
367        RECIPE_SLOT = "RecipeSlot",
368        RECIPE_RESULT = "RecipeResult",
369        RECIPE_COUNT = "RecipeCount",
370        /// A block in 3D, at a slot's angle (a recipe layout's station).
371        BLOCK_SLOT = "BlockSlot",
372        /// A book page type's elements.
373        BOOK_HEADER = "BookHeader",
374        BOOK_TEXT = "BookText",
375        BOOK_ITEM = "BookItem",
376        /// A picture the mod's code draws.
377        DRAWN = "Drawn",
378    }
379
380    /// The fields of the game's tag files (`data/<ns>/tags/<registry>/<path>.json`).
381    tag_file {
382        VALUES = crate::word::VALUES,
383        /// What a loader reads alongside `values` (Forge's).
384        OPTIONAL = crate::word::OPTIONAL,
385        REPLACE = "replace",
386        /// An entry that may be missing: `{ "id": …, "required": false }`.
387        ID = crate::word::ID,
388        REQUIRED = "required",
389    }
390
391    /// The game's atlas definitions (`atlases/<atlas>.json`): their sources —
392    /// a whole texture (`single`), or sprites cut from one picture
393    /// (`unstitch`, its regions).
394    atlas_source {
395        SOURCES = "sources",
396        TYPE = crate::word::TYPE,
397        SINGLE = "single",
398        UNSTITCH = "unstitch",
399        RESOURCE = "resource",
400        SPRITE = crate::word::SPRITE,
401        DIVISOR_X = "divisor_x",
402        DIVISOR_Y = "divisor_y",
403        REGIONS = "regions",
404        X = crate::word::X,
405        Y = crate::word::Y,
406        WIDTH = crate::word::WIDTH,
407        HEIGHT = crate::word::HEIGHT,
408        /// The game's atlases of blocks and of items.
409        BLOCKS = crate::word::BLOCKS,
410        ITEMS = crate::word::ITEMS,
411    }
412
413    /// The texture variables of the game's block models (`cube_all`'s `all`, a
414    /// column's `end`, …) — beside the faces' own names (`up`, `north`, …).
415    texture_slot {
416        ALL = "all",
417        SIDE = "side",
418        TOP = crate::word::TOP,
419        BOTTOM = crate::word::BOTTOM,
420        END = crate::word::END,
421        FRONT = "front",
422        /// A one-texture model's.
423        TEXTURE = crate::word::TEXTURE,
424    }
425
426    /// The game's block state properties Yog's blocks get, and their values.
427    block_state {
428        /// The way a block faces (a `direction`): the four sides, or up and down too.
429        FACING = "facing",
430        /// What an attached block hangs on.
431        FACE = "face",
432        FLOOR = "floor",
433        WALL = crate::word::WALL,
434        CEILING = "ceiling",
435        /// Whether it stands in water.
436        WATERLOGGED = "waterlogged",
437        /// A yes/no property's values.
438        FALSE = crate::word::FALSE,
439        TRUE = crate::word::TRUE,
440    }
441
442    /// The fields and kinds of the game's loot tables (`data/<ns>/loot_table/…`).
443    loot {
444        TYPE = crate::word::TYPE,
445        POOLS = "pools",
446        ROLLS = "rolls",
447        ENTRIES = crate::word::ENTRIES,
448        NAME = crate::word::NAME,
449        CONDITIONS = "conditions",
450        CONDITION = "condition",
451        FUNCTIONS = "functions",
452        FUNCTION = crate::word::FUNCTION,
453        COUNT = crate::word::COUNT,
454        MIN = "min",
455        MAX = "max",
456        BLOCK = crate::word::BLOCK,
457        PROPERTIES = "properties",
458        /// A block's table, and one nothing uses the way of.
459        BLOCK_TABLE = crate::id!(crate::ns::MINECRAFT, crate::word::BLOCK),
460        GENERIC_TABLE = crate::id!(crate::ns::MINECRAFT, crate::word::GENERIC),
461        /// An entry of an item.
462        ITEM_ENTRY = crate::id!(crate::ns::MINECRAFT, crate::word::ITEM),
463        /// A number between `min` and `max`.
464        UNIFORM = crate::id!(crate::ns::MINECRAFT, crate::game_font::UNIFORM),
465        SET_COUNT = crate::id!(crate::ns::MINECRAFT, "set_count"),
466        EXPLOSION_DECAY = crate::id!(crate::ns::MINECRAFT, "explosion_decay"),
467        SURVIVES_EXPLOSION = crate::id!(crate::ns::MINECRAFT, "survives_explosion"),
468        BLOCK_STATE_PROPERTY = crate::id!(crate::ns::MINECRAFT, "block_state_property"),
469        /// Where blocks' tables are: `loot_table/blocks/<path>`.
470        BLOCKS = crate::concatcp!(crate::word::BLOCKS, crate::sep::PATH),
471    }
472
473    /// The fields of a dimension as the build hands it to the runtime and
474    /// the runtime to the host.
475    dimension_field {
476        ID = crate::word::ID,
477        DIMENSION_TYPE = crate::concatcp!(crate::kind::DIMENSION, crate::sep::WORD, crate::word::TYPE),
478        BIOME = crate::kind::BIOME,
479        STRUCTURES = "structures",
480        FEATURES = "features",
481        MOB_SPAWNING = "mob_spawning",
482        /// The generator its chunks come from: its own terrain's, or one in code.
483        GENERATOR_TYPE = "generator_type",
484        /// Its terrain, which the runtime keeps (the host never sees it).
485        TERRAIN = "terrain",
486    }
487
488    /// Words a `.yui` attribute's value is.
489    yui_value {
490        TRUE = crate::word::TRUE,
491        FALSE = crate::word::FALSE,
492        /// A size the content decides.
493        AUTO = crate::word::AUTO,
494        START = crate::word::START,
495        CENTER = crate::word::CENTER,
496        END = crate::word::END,
497        LEFT = crate::word::LEFT,
498        RIGHT = crate::word::RIGHT,
499        TOP = crate::word::TOP,
500        BOTTOM = crate::word::BOTTOM,
501        /// Takes the room there is.
502        FILL = crate::word::FILL,
503        STRETCH = crate::word::STRETCH,
504        OUTLINE = crate::word::OUTLINE,
505        NONE = crate::word::NONE,
506    }
507
508    /// The markup of a `.yui` attribute's value: a binding (`{x:Bind name}`)
509    /// opens and closes so.
510    yui_markup {
511        BIND_OPEN = "{x:Bind ",
512        BIND_CLOSE = "}",
513        /// A binding's start, either way it's written (`{x:Bind …}`, `{Binding …}`).
514        BIND = "{x:Bind",
515        BINDING = "{Binding",
516        /// A design-time attribute: `d:text="Sample"` shows in the designer only.
517        DESIGN = "d:",
518        /// What a screen's resources element ends with: `<Screen.Resources>`.
519        RESOURCES = crate::concatcp!(crate::sep::DOT, "Resources"),
520    }
521
522
523    /// The game's kinds of tool (`item.tool.kind`); a mod's kind is the
524    /// block tag of what it mines.
525    tool_kind {
526        PICKAXE = "pickaxe",
527        AXE = "axe",
528        SHOVEL = "shovel",
529        HOE = "hoe",
530        /// A weapon: it mines nothing of its own.
531        SWORD = "sword",
532    }
533
534    /// The fields of the game's model JSON (block and item models, block states' variants).
535    model {
536        PARENT = "parent",
537        TEXTURES = "textures",
538        ELEMENTS = "elements",
539        DISPLAY = crate::word::DISPLAY,
540        FACES = "faces",
541        FROM = "from",
542        TO = "to",
543        UV = crate::word::UV,
544        ROTATION = "rotation",
545        TEXTURE = crate::word::TEXTURE,
546        /// A sprite item's (`item/generated`) first layer.
547        LAYER0 = "layer0",
548        /// The texture a block's particles take, and what a face falls back to.
549        PARTICLE = crate::word::PARTICLE,
550        /// A block state variant's model.
551        MODEL = crate::word::MODEL,
552        /// An element's rotation.
553        ORIGIN = "origin",
554        AXIS = "axis",
555        ANGLE = "angle",
556        RESCALE = "rescale",
557        /// Block states: variants by property values, or parts applied when they match.
558        VARIANTS = "variants",
559        MULTIPART = "multipart",
560        WHEN = crate::word::WHEN,
561        APPLY = "apply",
562        OR = "OR",
563        AND = "AND",
564        /// How a block's model is drawn (Forge/NeoForge read it; Fabric ignores it).
565        RENDER_TYPE = "render_type",
566        /// An item sprite's layers: `layer0`, `layer1`, …
567        LAYER = "layer",
568        SHADE = "shade",
569        CULLFACE = "cullface",
570        TINTINDEX = "tintindex",
571        AMBIENT_OCCLUSION = "ambientocclusion",
572        GUI_LIGHT = "gui_light",
573        TRANSLATION = "translation",
574        SCALE = "scale",
575        /// The parent a block model of its own elements takes: how it's held and shown in a slot.
576        BLOCK_PARENT = crate::id!(crate::ns::MINECRAFT, crate::concatcp!(crate::res::BLOCK_DIR, crate::kind::BLOCK)),
577        X = crate::word::X,
578        Y = crate::word::Y,
579        UVLOCK = "uvlock",
580        WEIGHT = "weight",
581    }
582
583    /// The fields of Yog's content files (`.yblock`, `.yitem`, `.ydef`) the tools read directly.
584    content_field {
585        ID = crate::word::ID,
586        KIND = crate::word::KIND,
587        MODEL = crate::word::MODEL,
588        ITEM_MODEL = crate::concatcp!(crate::kind::ITEM, crate::sep::WORD, crate::word::MODEL),
589        MATERIAL = crate::kind::MATERIAL,
590        ITEM = crate::kind::ITEM,
591        POTION = crate::kind::POTION,
592        EFFECTS = "effects",
593        EFFECT = crate::kind::EFFECT,
594        OF = "of",
595        COLOR = crate::word::COLOR,
596    }
597
598    /// The attributes of `.yui` elements.
599    yui_attr {
600        ID = crate::word::ID,
601        X = crate::word::X,
602        Y = crate::word::Y,
603        W = "w",
604        H = "h",
605        MIN_W = "min_w",
606        MIN_H = "min_h",
607        FLEX = "flex",
608        DOCK = "dock",
609        GAP = "gap",
610        PADDING = "padding",
611        BG = "bg",
612        COLOR = crate::word::COLOR,
613        ALIGN = "align",
614        HALIGN = "halign",
615        VALIGN = "valign",
616        MARGIN = "margin",
617        FONT_SCALE = "font_scale",
618        FONT = crate::kind::FONT,
619        SHADOW = "shadow",
620        NO_WRAP = "no_wrap",
621        ELLIPSIS = "ellipsis",
622        FOCUS_STYLE = "focus_style",
623        FOCUS_COLOR = "focus_color",
624        ENABLED = "enabled",
625        ON_CLICK = "on_click",
626        TOOLTIP = "tooltip",
627        WIDTH = crate::word::WIDTH,
628        HEIGHT = crate::word::HEIGHT,
629        ANCHOR = "anchor",
630        MODAL = "modal",
631        PAUSE = "pause",
632        LIVE = "live",
633        THEME = "theme",
634        TEXT = crate::word::TEXT,
635        PLACEHOLDER = "placeholder",
636        MAX_LENGTH = "max_length",
637        ON_CHANGE = "on_change",
638        ON_SUBMIT = "on_submit",
639        ITEM = crate::kind::ITEM,
640        COUNT = crate::word::COUNT,
641        INDEX = "index",
642        ACCEPTS = "accepts",
643        SOURCE = crate::word::SOURCE,
644        STRETCH = crate::word::STRETCH,
645        UV = crate::word::UV,
646        TINT = "tint",
647        KIND = crate::word::KIND,
648        RESULT = crate::word::RESULT,
649        PLACES = "places",
650        RECIPE_LAYOUT = "recipe_layout",
651        SLOT = "slot",
652        BLOCK = crate::kind::BLOCK,
653        /// A slot frame behind it, for layouts without their own picture.
654        FRAME = crate::word::FRAME,
655        SIZE = crate::word::SIZE,
656        /// A `<Component>` that is a kind of book page, its id.
657        BOOK_PAGE = "book_page",
658        /// A `<Property>`'s.
659        NAME = crate::word::NAME,
660        TYPE = crate::word::TYPE,
661        DEFAULT = crate::word::DEFAULT,
662        /// A book page's image and drawn picture.
663        SRC = crate::word::SRC,
664        DRAWER = "drawer",
665        DATA = crate::word::DATA,
666        STYLE = "style",
667        BASED_ON = "based_on",
668        ORIENTATION = "orientation",
669        /// A `<Grid>`'s tracks (`rows="Auto,*,26"`), the room between them,
670        /// and a `RowDefinition`'s / `ColumnDefinition`'s limits.
671        ROWS = "rows",
672        COLUMNS = "columns",
673        ROW_SPACING = "row_spacing",
674        COLUMN_SPACING = "column_spacing",
675        MIN_HEIGHT = "min_height",
676        MAX_HEIGHT = "max_height",
677        MIN_WIDTH = "min_width",
678        MAX_WIDTH = "max_width",
679        VALUE = crate::word::VALUE,
680        SELECTED = "selected",
681        CHECKED = "checked",
682        ITEM_HEIGHT = "item_height",
683        SCROLL_KEY = "scroll_key",
684        VISIBLE = "visible",
685        /// A resource's or style's key, an element's name (its id), what a style is for.
686        X_KEY = "x:Key",
687        X_NAME = "x:Name",
688        /// A view-model screen's type, how it's made, a template's item type.
689        X_VIEW_MODEL = "x:ViewModel",
690        X_CREATE = "x:Create",
691        X_DATA_TYPE = "x:DataType",
692        TARGET = crate::word::TARGET,
693        GRID_ROW = crate::concatcp!(crate::yui::GRID, crate::sep::DOT, crate::yui::ROW),
694        GRID_COLUMN = crate::concatcp!(crate::yui::GRID, crate::sep::DOT, crate::yui::COLUMN),
695        GRID_ROWSPAN = crate::concatcp!(crate::yui::GRID, crate::sep::DOT, "RowSpan"),
696        GRID_COLUMNSPAN = crate::concatcp!(crate::yui::GRID, crate::sep::DOT, "ColumnSpan"),
697    }
698}