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