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