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