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