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        /// Where `yog build` writes: the generated crate, generated code, listings.
87        BUILD = crate::concatcp!(crate::sep::DOT, crate::ns::YOG, crate::sep::HYPHEN, "build"),
88    }
89
90    /// A game's folders Yog uses.
91    game_dir {
92        /// The `.yog` mods the game loads: `<game>/yog-mods`.
93        MODS = crate::concatcp!(crate::ns::YOG, crate::sep::HYPHEN, crate::word::MODS),
94    }
95
96
97    /// Yog's programs.
98    program {
99        /// The command-line tool (`yog build`, `yog schema`, …).
100        CLI = crate::ns::YOG,
101        /// The CLI's service command: tools read and write every format through it.
102        SERVE = "serve",
103    }
104
105    /// The structs the generated code names a mod's content by
106    /// (`Items::RUBY`); a `.yres` set of the same name holds that content's
107    /// names (`Items.yres`: `item.<mod>.<name>`).
108    code_set {
109        BLOCKS = "Blocks",
110        ITEMS = "Items",
111        ENTITIES = "Entities",
112        ADVANCEMENTS = "Advancements",
113        MODELS = "Models",
114        ANIMS = "Anims",
115        TEXTURES = "Textures",
116    }
117
118    /// Yog's crates a mod's code builds with, as Cargo names them (Rust's
119    /// name has `_` for `-`: [`crate::rust_name`]).
120    rust_crate {
121        /// What every one of Yog's crates is named with.
122        PREFIX = crate::concatcp!(crate::ns::YOG, crate::sep::HYPHEN),
123        /// The API crate: its word, its name, its name in Rust code, and the
124        /// `[dependencies]` key that pins its version alone.
125        API_WORD = "api",
126        API = crate::concatcp!(PREFIX, API_WORD),
127        API_RUST_NAME = crate::concatcp!(crate::ns::YOG, crate::sep::WORD, API_WORD),
128        API_VERSION_KEY = crate::concatcp!(API_RUST_NAME, crate::sep::WORD, crate::serve_method::VERSION),
129        ABI = crate::concatcp!(PREFIX, "abi"),
130        UI = crate::concatcp!(PREFIX, crate::word::UI),
131        KIT = crate::concatcp!(PREFIX, "kit"),
132        GFX = crate::concatcp!(PREFIX, "gfx"),
133        REGISTRY = crate::concatcp!(PREFIX, crate::serve_param::REGISTRY),
134        /// The data crate: its name, and its name in Rust code (yog-api's module of it too).
135        DATA = crate::concatcp!(PREFIX, crate::word::DATA),
136        DATA_RUST_NAME = crate::concatcp!(crate::ns::YOG, crate::sep::WORD, crate::word::DATA),
137    }
138
139    /// Where the game keeps resources, and what their files end with.
140    res {
141        /// The textures' folder: `<ns>:textures/<path>.png`.
142        TEXTURES = crate::concatcp!(crate::model::TEXTURES, crate::sep::PATH),
143        /// The models' folder: `<ns>:models/<path>.json`.
144        MODELS = crate::concatcp!(crate::word::MODELS, crate::sep::PATH),
145        /// The block states' folder: `<ns>:blockstates/<path>.json`.
146        BLOCKSTATES = crate::concatcp!("blockstates", crate::sep::PATH),
147        /// Items' textures and models: `item/apple`.
148        ITEM_DIR = crate::concatcp!(crate::kind::ITEM, crate::sep::PATH),
149        /// Item definitions (1.21.4+): `<ns>:items/<path>.json`.
150        ITEM_DEFINITIONS = crate::concatcp!(crate::word::ITEMS, crate::sep::PATH),
151        /// Equipment's worn looks (1.21.4+): `<ns>:equipment/<path>.json`.
152        EQUIPMENT = crate::concatcp!(crate::word::EQUIPMENT, crate::sep::PATH),
153        /// Worn equipment's textures (1.21.4+): `entity/equipment/<layer>/<path>`.
154        EQUIPMENT_TEXTURES = crate::concatcp!(crate::kind::ENTITY, crate::sep::PATH, crate::word::EQUIPMENT, crate::sep::PATH),
155        /// Armor's worn textures before 1.21.4: `models/armor/<path>_layer_<n>`.
156        ARMOR_TEXTURES = crate::concatcp!(crate::word::MODELS, crate::sep::PATH, crate::word::ARMOR, crate::sep::PATH),
157        /// Between an armor texture's name and its layer's number.
158        ARMOR_LAYER = "_layer_",
159        /// What a spawn egg's item path ends with: `<mob>_spawn_egg`.
160        SPAWN_EGG_SUFFIX = crate::concatcp!(crate::sep::WORD, crate::word::SPAWN_EGG),
161        /// Blocks' textures and models: `block/stone`.
162        BLOCK_DIR = crate::concatcp!(crate::kind::BLOCK, crate::sep::PATH),
163        /// The GUI atlas's sprites under `textures/` (1.20.2+).
164        GUI_SPRITES = crate::concatcp!(crate::word::GUI, crate::sep::PATH, "sprites", crate::sep::PATH),
165        /// The atlases' definitions: `<ns>:atlases/<atlas>.json` (every pack's sources combine).
166        ATLASES = crate::concatcp!("atlases", crate::sep::PATH),
167        /// The language files' folder: `<ns>:lang/<locale>.json`.
168        LANG = crate::concatcp!(crate::typed::LANG, crate::sep::PATH),
169        /// Models the game draws in code (`builtin/entity`), not from elements.
170        BUILTIN = crate::concatcp!("builtin", crate::sep::PATH),
171        /// Sounds: `<ns>:sounds/<path>.ogg`, their events in `<ns>:sounds.json`.
172        SOUNDS = crate::concatcp!(SOUNDS_WORD, crate::sep::PATH),
173        SOUNDS_JSON = crate::concatcp!(SOUNDS_WORD, JSON),
174        SOUNDS_WORD = "sounds",
175        /// Particles' pictures: `<ns>:particles/<name>.json`.
176        PARTICLES = crate::concatcp!("particles", crate::sep::PATH),
177        OGG = ".ogg",
178        PNG = crate::concatcp!(crate::sep::DOT, crate::word::PNG),
179        SVG = ".svg",
180        JSON = ".json",
181        MCMETA = ".mcmeta",
182    }
183
184    /// Yog's own ids.
185    yog {
186        /// An entity's data the hosts keep for the mods.
187        STATE = crate::id!(crate::ns::YOG, crate::word::STATE),
188        /// A hanging entity's attachment (its face, size, item).
189        HANGING = crate::id!(crate::ns::YOG, "hanging"),
190        /// The key an entity's data is saved under in its NBT.
191        ENTITY_NBT = crate::id!(crate::ns::YOG, crate::word::DATA),
192        /// The channel entity data is synced on.
193        ENTITY_DATA = crate::id!(crate::ns::YOG, crate::concatcp!(crate::kind::ENTITY, crate::sep::WORD, crate::word::DATA)),
194        /// The entity data key an entity's own hitbox travels under: width,
195        /// height, eye height as three little-endian f32.
196        DIMENSIONS = crate::id!(crate::ns::YOG, "dimensions"),
197        /// An inventory slot widget's id: `yog:slot:<index>`.
198        SLOT_PREFIX = crate::id!(crate::ns::YOG, "slot:"),
199        /// The player's inventory widget.
200        PLAYER_INVENTORY = crate::id!(crate::ns::YOG, crate::concatcp!(crate::word::PLAYER, crate::sep::WORD, crate::kind::INVENTORY)),
201        /// A machine screen's id: `yog:machine:<id>`.
202        MACHINE_PREFIX = crate::id!(crate::ns::YOG, "machine:"),
203        /// Yog's alias of a game potion: `yog:potion/<name>`.
204        POTION_ALIAS = crate::id!(crate::ns::YOG, "potion/"),
205        /// Yog's alias of a game font, `yog:font/<name>` — the only way
206        /// anything names one of the game's fonts.
207        FONT_ALIAS = crate::id!(crate::ns::YOG, "font/"),
208        /// The font text is drawn in by default (the game's).
209        DEFAULT_FONT = crate::concatcp!(FONT_ALIAS, crate::game_font::DEFAULT),
210        /// The model every mod's spawn egg inherits: Yog's egg in two layers, base and spots.
211        SPAWN_EGG_MODEL = crate::id!(crate::ns::YOG, crate::concatcp!(crate::res::ITEM_DIR, crate::word::SPAWN_EGG)),
212        /// The book's pictures.
213        BOOK_SHEET = crate::concatcp!(BOOK_TEXTURE, crate::sep::PATH, crate::kind::BOOK),
214        CRAFTING_SHEET = crate::concatcp!(BOOK_TEXTURE, crate::sep::PATH, "crafting"),
215        /// A screen being designed in the IDE.
216        DESIGNER_SCREEN = crate::id!(crate::ns::YOG, "designer"),
217        /// The screen a cutscene plays in (the runtime's own).
218        CUTSCENE_SCREEN = crate::id!(crate::ns::YOG, crate::word::CUTSCENE),
219        /// A book's default texture (its sheet is [`BOOK_SHEET`]).
220        BOOK_TEXTURE = crate::id!(crate::ns::YOG, crate::concatcp!(crate::word::GUI, crate::sep::PATH, crate::kind::BOOK)),
221        /// The textures the runtime renders SVG images into: `<prefix><key>_<w>x<h>`.
222        DYNAMIC_SVG_PREFIX = crate::id!(crate::ns::YOG, crate::concatcp!(crate::word::DYNAMIC, crate::sep::PATH, "svg", crate::sep::WORD)),
223        /// The textures the runtime shows videos' frames in:
224        /// `<prefix><player>.png`, a texture's full id (an image source as it is).
225        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)),
226        /// The textures the runtime draws text in Yog's fonts into: `<prefix><n>`.
227        DYNAMIC_TEXT_PREFIX = crate::id!(crate::ns::YOG, crate::concatcp!(crate::word::DYNAMIC, crate::sep::PATH, crate::word::TEXT, crate::sep::WORD)),
228    }
229
230    /// The game's fonts, by name: Yog aliases each as
231    /// `yog:font/<name>` ([`crate::yog::FONT_ALIAS`]).
232    game_font {
233        DEFAULT = crate::word::DEFAULT,
234        /// Unifont.
235        UNIFORM = "uniform",
236        /// The enchanting table's.
237        ALT = "alt",
238        ILLAGERALT = "illageralt",
239    }
240
241    /// The game's attributes by name — the hosts find each on every
242    /// version (`max_health`, `generic.max_health` before 1.21.2).
243    attribute {
244        MAX_HEALTH = "max_health",
245    }
246
247    /// The game's modes a player is put in.
248    gamemode {
249        SURVIVAL = "survival",
250        CREATIVE = "creative",
251        ADVENTURE = "adventure",
252        SPECTATOR = "spectator",
253    }
254
255    /// The game's ids Yog's code names.
256    game {
257        /// The game's own id of its default font (hosts only; everything
258        /// else says [`crate::yog::DEFAULT_FONT`]).
259        DEFAULT_FONT = crate::id!(crate::ns::MINECRAFT, crate::game_font::DEFAULT),
260        /// The UI theme drawn like the game's own screens.
261        VANILLA_THEME = crate::id!(crate::ns::MINECRAFT, "vanilla"),
262        OVERWORLD = crate::id!(crate::ns::MINECRAFT, "overworld"),
263        /// The empty block: what's left where a block is removed.
264        AIR = crate::id!(crate::ns::MINECRAFT, crate::word::AIR),
265        /// The player entity's type.
266        PLAYER = crate::id!(crate::ns::MINECRAFT, crate::word::PLAYER),
267        /// The sound event that plays nothing: a block or item without a sound of its own.
268        NO_SOUND = crate::id!(crate::ns::MINECRAFT, "intentionally_empty"),
269        /// The biome a dimension is all of when it doesn't say.
270        PLAINS = crate::id!(crate::ns::MINECRAFT, "plains"),
271        THE_NETHER = crate::id!(crate::ns::MINECRAFT, "the_nether"),
272        THE_END = crate::id!(crate::ns::MINECRAFT, "the_end"),
273        /// The block tags of what each kind of tool mines: `<MINEABLE><kind>`.
274        MINEABLE = crate::id!(crate::ns::MINECRAFT, "mineable/"),
275        /// The texture the game draws where one is missing.
276        MISSING_TEXTURE = crate::id!(crate::ns::MINECRAFT, "missingno"),
277        /// What a book is given to players as.
278        WRITTEN_BOOK = crate::id!(crate::ns::MINECRAFT, "written_book"),
279        BOOK = crate::id!(crate::ns::MINECRAFT, crate::kind::BOOK),
280        /// What the game's attributes were named under before 1.21.2: `generic.max_health`.
281        OLD_ATTRIBUTE_PREFIX = crate::concatcp!(crate::word::GENERIC, crate::sep::DOT),
282        /// The language every lang file falls back to, and a mod's texts are written in.
283        LOCALE = "en_us",
284    }
285
286
287    /// The kinds of shape a schema describes itself with
288    /// (`yog_data::Shape::describe`, read by the IDE's property grids).
289    shape_kind {
290        ANY = crate::word::ANY,
291        BOOL = crate::word::BOOL,
292        INT = crate::word::INT,
293        FLOAT = "float",
294        STRING = crate::word::STRING,
295        ATOM = "atom",
296        TEXT = crate::word::TEXT,
297        IMAGE = crate::word::IMAGE,
298        COLOR = crate::word::COLOR,
299        BYTES = crate::word::BYTES,
300        RES = "res",
301        REF = "ref",
302        TAG = crate::kind::TAG,
303        REF_OR_TAG = "ref_or_tag",
304        REF_OR_IMAGE = "ref_or_image",
305        LIST = "list",
306        MAP = "map",
307        OPTIONAL = crate::word::OPTIONAL,
308        STRUCT = "struct",
309        ENUM = "enum",
310        /// A struct or enum written once in `defs`, referred to by name.
311        DEF = "def",
312    }
313
314    /// The elements of a `.yui` screen or component.
315    yui {
316        SCREEN = "Screen",
317        COMPONENT = "Component",
318        /// A component's declarations.
319        PROPERTY = "Property",
320        EVENT = "Event",
321        STYLE = "Style",
322        CANVAS = "Canvas",
323        COLUMN = "Column",
324        ROW = "Row",
325        GRID = "Grid",
326        /// A `<Grid>`'s row and column with limits, and the property elements
327        /// that hold them, as WPF writes them.
328        ROW_DEFINITION = "RowDefinition",
329        COLUMN_DEFINITION = "ColumnDefinition",
330        ROW_DEFINITIONS = crate::concatcp!(GRID, crate::sep::DOT, ROW_DEFINITION, crate::data_layout::PLURAL),
331        COLUMN_DEFINITIONS = crate::concatcp!(GRID, crate::sep::DOT, COLUMN_DEFINITION, crate::data_layout::PLURAL),
332        SCROLL_VIEW = "ScrollView",
333        LABEL = "Label",
334        BUTTON = "Button",
335        TOGGLE_BUTTON = "ToggleButton",
336        TEXT_BOX = "TextBox",
337        IMAGE = "Image",
338        VIDEO = "Video",
339        SURFACE = "Surface",
340        SPACER = "Spacer",
341        STAT_BAR = "StatBar",
342        LIST_VIEW = "ListView",
343        ITEMS_CONTROL = "ItemsControl",
344        CONTENT_PRESENTER = "ContentPresenter",
345        /// Slots: an item shown, an inventory's, the container's.
346        ITEM_SLOT = "ItemSlot",
347        INV_SLOT = "InvSlot",
348        SLOT = "Slot",
349        PLAYER_INVENTORY = "PlayerInventory",
350        /// Which container slot is which, for a block that makes recipes.
351        MACHINE = "Machine",
352        /// A kind of recipe's layout on an inventory screen.
353        RECIPE_AREA = "RecipeArea",
354        /// A recipe layout's places.
355        RECIPE_SLOT = "RecipeSlot",
356        RECIPE_RESULT = "RecipeResult",
357        RECIPE_COUNT = "RecipeCount",
358        /// A block in 3D, at a slot's angle (a recipe layout's station).
359        BLOCK_SLOT = "BlockSlot",
360        /// A book page type's elements.
361        BOOK_HEADER = "BookHeader",
362        BOOK_TEXT = "BookText",
363        BOOK_ITEM = "BookItem",
364        /// A picture the mod's code draws.
365        DRAWN = "Drawn",
366    }
367
368    /// A request to the CLI's service (`yog serve`): the method and its parameters.
369    serve_request {
370        METHOD = "method",
371        PARAMS = "params",
372    }
373
374    /// The parameters of the CLI's service methods (`yog serve`, what the IDE calls).
375    serve_param {
376        PATH = "path",
377        NAME = crate::word::NAME,
378        TEXT = crate::word::TEXT,
379        SIZE = crate::word::SIZE,
380        TEXTURE = crate::kind::TEXTURE,
381        SOUND = crate::kind::SOUND,
382        PNG = crate::word::PNG,
383        ANIMATION = crate::word::ANIMATION,
384        KIND = crate::word::KIND,
385        REGISTRY = "registry",
386        ID = crate::word::ID,
387        ALIAS = "alias",
388        MODEL = crate::word::MODEL,
389        SOURCE = crate::word::SOURCE,
390        FORCE = "force",
391        WIDTH = crate::word::WIDTH,
392        HEIGHT = crate::word::HEIGHT,
393        TAG = crate::kind::TAG,
394        ARGS = "args",
395        EVENT = crate::word::EVENT,
396        FILE = crate::word::FILE,
397        SET = crate::bus_word::SET,
398        MOD_ID = crate::word::MOD,
399        ENTRIES = crate::word::ENTRIES,
400        NEXT = "next",
401        LEVEL = crate::kind::LEVEL,
402        VALUE = crate::word::VALUE,
403        VALUES = crate::word::VALUES,
404        FORMAT = "format",
405        FRAME = crate::word::FRAME,
406        KEY = crate::word::KEY,
407    }
408
409    /// The methods of `yog serve` (the CLI as a service), by the name a tool
410    /// (Yog-IDLE) calls them; their parameters are `serve_param`.
411    serve_method {
412        ADVANCEMENT_RENDER = "advancement_render",
413        BODY_TEXTURE = "body_texture",
414        BOOK_DESIGNER_CLOSE = "book_designer_close",
415        BOOK_DESIGNER_RENDER = "book_designer_render",
416        BOOK_PAGE_PREVIEW = "book_page_preview",
417        CONTENT_ARMOR_MATERIALS = "content_armor_materials",
418        CONTENT_BLOCK_KINDS = "content_block_kinds",
419        CONTENT_DEFS = "content_defs",
420        CONTENT_IMPORT = "content_import",
421        CONTENT_ITEM_POTION_COLOR = "content_item_potion_color",
422        CONTENT_MOD_ID = "content_mod_id",
423        CONTENT_PARENT_MODEL = "content_parent_model",
424        CONTENT_REFS = "content_refs",
425        CONTENT_SAVE_TEXTURE = "content_save_texture",
426        CONTENT_SAVE_TEXTURE_ANIMATION = "content_save_texture_animation",
427        CONTENT_SOUND_GROUPS = "content_sound_groups",
428        CONTENT_STRINGS = "content_strings",
429        CONTENT_TAGS = "content_tags",
430        CONTENT_TEXTURE = "content_texture",
431        CONTENT_TEXTURES = "content_textures",
432        CONTENT_TOOL_MATERIALS = "content_tool_materials",
433        DATA_FORMAT = "data.format",
434        DATA_PARSE = "data.parse",
435        DATA_PATCH = "data.patch",
436        FONT_COPY = "font_copy",
437        FORMAT_COMPLETE = "format.complete",
438        FORMAT_SHAPE = "format.shape",
439        ITEM_TAG_ITEMS = "item_tag_items",
440        MEDIA_IMPORT = "media.import",
441        MEDIA_PICTURES = "media.pictures",
442        MOD_ID = "mod.id",
443        RECIPE_KIND_CREATE = "recipe_kind_create",
444        RECIPE_KINDS = "recipe_kinds",
445        SOUND_DATA = "sound_data",
446        SOUND_LIST = "sound_list",
447        /// The mod's videos (`@Videos.intro`), what a `.yvideo` can show.
448        VIDEO_LIST = "video_list",
449        /// A `.yvideo` as edited, rendered as the build renders it.
450        VIDEO_PREVIEW = "video_preview",
451        /// A render's frame, decoded as the game decodes it (PNG).
452        VIDEO_FRAME = "video_frame",
453        SOURCE_CHECK = "source.check",
454        SOURCE_READ = "source.read",
455        SOURCE_WRITE = "source.write",
456        TEXTURE_ANIMATION_FORMAT = "texture_animation_format",
457        TEXTURE_ANIMATION_RESOLVE = "texture_animation_resolve",
458        TEXTURE_FILE_ID = "texture_file_id",
459        TYPED_CLASSIFY = "typed.classify",
460        VERSION = "version",
461        WORLDGEN_PREVIEW = "worldgen_preview",
462        YRES_PARSE = "yres.parse",
463        YRES_WRITE = "yres.write",
464        YUI_CODEGEN = "yui_codegen",
465        YUI_DESIGNER_COMPONENTS = "yui_designer_components",
466        YUI_DESIGNER_EVENT = "yui_designer_event",
467        YUI_DESIGNER_RENDER = "yui_designer_render",
468        YUI_DESIGNER_RESET = "yui_designer_reset",
469        YUI_EVENT_HANDLER = "yui_event_handler",
470        YUI_IMAGE_PREVIEW = "yui_image_preview",
471        YUI_IMAGE_SOURCES = "yui_image_sources",
472    }
473
474    /// The fields of the game's tag files (`data/<ns>/tags/<registry>/<path>.json`).
475    tag_file {
476        VALUES = crate::word::VALUES,
477        /// What a loader reads alongside `values` (Forge's).
478        OPTIONAL = crate::word::OPTIONAL,
479        REPLACE = "replace",
480        /// An entry that may be missing: `{ "id": …, "required": false }`.
481        ID = crate::word::ID,
482        REQUIRED = "required",
483    }
484
485    /// The game's atlas definitions (`atlases/<atlas>.json`): their sources —
486    /// a whole texture (`single`), or sprites cut from one picture
487    /// (`unstitch`, its regions).
488    atlas_source {
489        SOURCES = "sources",
490        TYPE = crate::word::TYPE,
491        SINGLE = "single",
492        UNSTITCH = "unstitch",
493        RESOURCE = "resource",
494        SPRITE = crate::word::SPRITE,
495        DIVISOR_X = "divisor_x",
496        DIVISOR_Y = "divisor_y",
497        REGIONS = "regions",
498        X = crate::word::X,
499        Y = crate::word::Y,
500        WIDTH = crate::word::WIDTH,
501        HEIGHT = crate::word::HEIGHT,
502        /// The game's atlases of blocks and of items.
503        BLOCKS = crate::word::BLOCKS,
504        ITEMS = crate::word::ITEMS,
505    }
506
507    /// The texture variables of the game's block models (`cube_all`'s `all`, a
508    /// column's `end`, …) — beside the faces' own names (`up`, `north`, …).
509    texture_slot {
510        ALL = "all",
511        SIDE = "side",
512        TOP = crate::word::TOP,
513        BOTTOM = crate::word::BOTTOM,
514        END = crate::word::END,
515        FRONT = "front",
516        /// A one-texture model's.
517        TEXTURE = crate::word::TEXTURE,
518    }
519
520    /// The game's block state properties Yog's blocks get, and their values.
521    block_state {
522        /// The way a block faces (a `direction`): the four sides, or up and down too.
523        FACING = "facing",
524        /// What an attached block hangs on.
525        FACE = "face",
526        FLOOR = "floor",
527        WALL = crate::word::WALL,
528        CEILING = "ceiling",
529        /// Whether it stands in water.
530        WATERLOGGED = "waterlogged",
531        /// A yes/no property's values.
532        FALSE = crate::word::FALSE,
533        TRUE = crate::word::TRUE,
534    }
535
536    /// The fields and kinds of the game's loot tables (`data/<ns>/loot_table/…`).
537    loot {
538        TYPE = crate::word::TYPE,
539        POOLS = "pools",
540        ROLLS = "rolls",
541        ENTRIES = crate::word::ENTRIES,
542        NAME = crate::word::NAME,
543        CONDITIONS = "conditions",
544        CONDITION = "condition",
545        FUNCTIONS = "functions",
546        FUNCTION = crate::word::FUNCTION,
547        COUNT = crate::word::COUNT,
548        MIN = "min",
549        MAX = "max",
550        BLOCK = crate::word::BLOCK,
551        PROPERTIES = "properties",
552        /// A block's table, and one nothing uses the way of.
553        BLOCK_TABLE = crate::id!(crate::ns::MINECRAFT, crate::word::BLOCK),
554        GENERIC_TABLE = crate::id!(crate::ns::MINECRAFT, crate::word::GENERIC),
555        /// An entry of an item.
556        ITEM_ENTRY = crate::id!(crate::ns::MINECRAFT, crate::word::ITEM),
557        /// A number between `min` and `max`.
558        UNIFORM = crate::id!(crate::ns::MINECRAFT, crate::game_font::UNIFORM),
559        SET_COUNT = crate::id!(crate::ns::MINECRAFT, "set_count"),
560        EXPLOSION_DECAY = crate::id!(crate::ns::MINECRAFT, "explosion_decay"),
561        SURVIVES_EXPLOSION = crate::id!(crate::ns::MINECRAFT, "survives_explosion"),
562        BLOCK_STATE_PROPERTY = crate::id!(crate::ns::MINECRAFT, "block_state_property"),
563        /// Where blocks' tables are: `loot_table/blocks/<path>`.
564        BLOCKS = crate::concatcp!(crate::word::BLOCKS, crate::sep::PATH),
565    }
566
567    /// The fields of a dimension as the build hands it to the runtime and
568    /// the runtime to the host.
569    dimension_field {
570        ID = crate::word::ID,
571        DIMENSION_TYPE = crate::concatcp!(crate::kind::DIMENSION, crate::sep::WORD, crate::word::TYPE),
572        BIOME = crate::kind::BIOME,
573        STRUCTURES = "structures",
574        FEATURES = "features",
575        MOB_SPAWNING = "mob_spawning",
576        /// The generator its chunks come from: its own terrain's, or one in code.
577        GENERATOR_TYPE = "generator_type",
578        /// Its terrain, which the runtime keeps (the host never sees it).
579        TERRAIN = "terrain",
580    }
581
582    /// Words a `.yui` attribute's value is.
583    yui_value {
584        TRUE = crate::word::TRUE,
585        FALSE = crate::word::FALSE,
586        /// A size the content decides.
587        AUTO = crate::word::AUTO,
588        START = crate::word::START,
589        CENTER = crate::word::CENTER,
590        END = crate::word::END,
591        LEFT = crate::word::LEFT,
592        RIGHT = crate::word::RIGHT,
593        TOP = crate::word::TOP,
594        BOTTOM = crate::word::BOTTOM,
595        /// Takes the room there is.
596        FILL = crate::word::FILL,
597        STRETCH = crate::word::STRETCH,
598        OUTLINE = crate::word::OUTLINE,
599        NONE = crate::word::NONE,
600    }
601
602    /// The markup of a `.yui` attribute's value: a binding (`{x:Bind name}`)
603    /// opens and closes so.
604    yui_markup {
605        BIND_OPEN = "{x:Bind ",
606        BIND_CLOSE = "}",
607        /// A binding's start, either way it's written (`{x:Bind …}`, `{Binding …}`).
608        BIND = "{x:Bind",
609        BINDING = "{Binding",
610        /// A design-time attribute: `d:text="Sample"` shows in the designer only.
611        DESIGN = "d:",
612        /// What a screen's resources element ends with: `<Screen.Resources>`.
613        RESOURCES = crate::concatcp!(crate::sep::DOT, "Resources"),
614    }
615
616
617    /// The game's kinds of tool (`item.tool.kind`); a mod's kind is the
618    /// block tag of what it mines.
619    tool_kind {
620        PICKAXE = "pickaxe",
621        AXE = "axe",
622        SHOVEL = "shovel",
623        HOE = "hoe",
624        /// A weapon: it mines nothing of its own.
625        SWORD = "sword",
626    }
627
628    /// The fields of the game's model JSON (block and item models, block states' variants).
629    model {
630        PARENT = "parent",
631        TEXTURES = "textures",
632        ELEMENTS = "elements",
633        DISPLAY = crate::word::DISPLAY,
634        FACES = "faces",
635        FROM = "from",
636        TO = "to",
637        UV = crate::word::UV,
638        ROTATION = "rotation",
639        TEXTURE = crate::word::TEXTURE,
640        /// A sprite item's (`item/generated`) first layer.
641        LAYER0 = "layer0",
642        /// The texture a block's particles take, and what a face falls back to.
643        PARTICLE = crate::word::PARTICLE,
644        /// A block state variant's model.
645        MODEL = crate::word::MODEL,
646        /// An element's rotation.
647        ORIGIN = "origin",
648        AXIS = "axis",
649        ANGLE = "angle",
650        RESCALE = "rescale",
651        /// Block states: variants by property values, or parts applied when they match.
652        VARIANTS = "variants",
653        MULTIPART = "multipart",
654        WHEN = crate::word::WHEN,
655        APPLY = "apply",
656        OR = "OR",
657        AND = "AND",
658        /// How a block's model is drawn (Forge/NeoForge read it; Fabric ignores it).
659        RENDER_TYPE = "render_type",
660        /// An item sprite's layers: `layer0`, `layer1`, …
661        LAYER = "layer",
662        SHADE = "shade",
663        CULLFACE = "cullface",
664        TINTINDEX = "tintindex",
665        AMBIENT_OCCLUSION = "ambientocclusion",
666        GUI_LIGHT = "gui_light",
667        TRANSLATION = "translation",
668        SCALE = "scale",
669        /// The parent a block model of its own elements takes: how it's held and shown in a slot.
670        BLOCK_PARENT = crate::id!(crate::ns::MINECRAFT, crate::concatcp!(crate::res::BLOCK_DIR, crate::kind::BLOCK)),
671        X = crate::word::X,
672        Y = crate::word::Y,
673        UVLOCK = "uvlock",
674        WEIGHT = "weight",
675    }
676
677    /// The fields of Yog's content files (`.yblock`, `.yitem`, `.ydef`) the tools read directly.
678    content_field {
679        ID = crate::word::ID,
680        KIND = crate::word::KIND,
681        MODEL = crate::word::MODEL,
682        ITEM_MODEL = crate::concatcp!(crate::kind::ITEM, crate::sep::WORD, crate::word::MODEL),
683        MATERIAL = crate::kind::MATERIAL,
684        ITEM = crate::kind::ITEM,
685        POTION = crate::kind::POTION,
686        EFFECTS = "effects",
687        EFFECT = crate::kind::EFFECT,
688        OF = "of",
689        COLOR = crate::word::COLOR,
690    }
691
692    /// The attributes of `.yui` elements.
693    yui_attr {
694        ID = crate::word::ID,
695        X = crate::word::X,
696        Y = crate::word::Y,
697        W = "w",
698        H = "h",
699        MIN_W = "min_w",
700        MIN_H = "min_h",
701        FLEX = "flex",
702        DOCK = "dock",
703        GAP = "gap",
704        PADDING = "padding",
705        BG = "bg",
706        COLOR = crate::word::COLOR,
707        ALIGN = "align",
708        HALIGN = "halign",
709        VALIGN = "valign",
710        MARGIN = "margin",
711        FONT_SCALE = "font_scale",
712        FONT = crate::kind::FONT,
713        SHADOW = "shadow",
714        NO_WRAP = "no_wrap",
715        ELLIPSIS = "ellipsis",
716        FOCUS_STYLE = "focus_style",
717        FOCUS_COLOR = "focus_color",
718        ENABLED = "enabled",
719        ON_CLICK = "on_click",
720        TOOLTIP = "tooltip",
721        WIDTH = crate::word::WIDTH,
722        HEIGHT = crate::word::HEIGHT,
723        ANCHOR = "anchor",
724        MODAL = "modal",
725        PAUSE = "pause",
726        LIVE = "live",
727        THEME = "theme",
728        TEXT = crate::word::TEXT,
729        PLACEHOLDER = "placeholder",
730        MAX_LENGTH = "max_length",
731        ON_CHANGE = "on_change",
732        ON_SUBMIT = "on_submit",
733        ITEM = crate::kind::ITEM,
734        COUNT = crate::word::COUNT,
735        INDEX = "index",
736        ACCEPTS = "accepts",
737        SOURCE = crate::word::SOURCE,
738        STRETCH = crate::word::STRETCH,
739        UV = crate::word::UV,
740        TINT = "tint",
741        KIND = crate::word::KIND,
742        RESULT = crate::word::RESULT,
743        PLACES = "places",
744        RECIPE_LAYOUT = "recipe_layout",
745        SLOT = "slot",
746        BLOCK = crate::kind::BLOCK,
747        /// A slot frame behind it, for layouts without their own picture.
748        FRAME = crate::word::FRAME,
749        SIZE = crate::word::SIZE,
750        /// A `<Component>` that is a kind of book page, its id.
751        BOOK_PAGE = "book_page",
752        /// A `<Property>`'s.
753        NAME = crate::word::NAME,
754        TYPE = crate::word::TYPE,
755        DEFAULT = crate::word::DEFAULT,
756        /// A book page's image and drawn picture.
757        SRC = crate::word::SRC,
758        DRAWER = "drawer",
759        DATA = crate::word::DATA,
760        STYLE = "style",
761        BASED_ON = "based_on",
762        ORIENTATION = "orientation",
763        /// A `<Grid>`'s tracks (`rows="Auto,*,26"`), the room between them,
764        /// and a `RowDefinition`'s / `ColumnDefinition`'s limits.
765        ROWS = "rows",
766        COLUMNS = "columns",
767        ROW_SPACING = "row_spacing",
768        COLUMN_SPACING = "column_spacing",
769        MIN_HEIGHT = "min_height",
770        MAX_HEIGHT = "max_height",
771        MIN_WIDTH = "min_width",
772        MAX_WIDTH = "max_width",
773        VALUE = crate::word::VALUE,
774        SELECTED = "selected",
775        CHECKED = "checked",
776        ITEM_HEIGHT = "item_height",
777        SCROLL_KEY = "scroll_key",
778        VISIBLE = "visible",
779        /// A resource's or style's key, an element's name (its id), what a style is for.
780        X_KEY = "x:Key",
781        X_NAME = "x:Name",
782        /// A view-model screen's type, how it's made, a template's item type.
783        X_VIEW_MODEL = "x:ViewModel",
784        X_CREATE = "x:Create",
785        X_DATA_TYPE = "x:DataType",
786        TARGET = crate::word::TARGET,
787        GRID_ROW = crate::concatcp!(crate::yui::GRID, crate::sep::DOT, crate::yui::ROW),
788        GRID_COLUMN = crate::concatcp!(crate::yui::GRID, crate::sep::DOT, crate::yui::COLUMN),
789        GRID_ROWSPAN = crate::concatcp!(crate::yui::GRID, crate::sep::DOT, "RowSpan"),
790        GRID_COLUMNSPAN = crate::concatcp!(crate::yui::GRID, crate::sep::DOT, "ColumnSpan"),
791    }
792}