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