1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
//! The game's data the build writes from `.ydef`s: worldgen features,
//! the loaders' biome modifiers, advancements.
names! {
/// The loaders a pack's overlays are for: `when/<loader>/<version>/…`.
loader {
FABRIC = "fabric",
FORGE = "forge",
NEOFORGE = "neoforge",
}
/// The game's data folders renamed in 1.21 (`data/<ns>/<dir>/`): before,
/// each was its name and [`crate::data_layout::PLURAL`].
renamed_data_dir {
ADVANCEMENT = crate::kind::ADVANCEMENT,
FUNCTION = crate::word::FUNCTION,
ITEM_MODIFIER = "item_modifier",
LOOT_TABLE = crate::kind::LOOT_TABLE,
PREDICATE = "predicate",
RECIPE = crate::kind::RECIPE,
STRUCTURE = "structure",
}
/// The tag folders renamed in 1.21 (`data/<ns>/tags/<dir>/`), likewise.
renamed_tag_dir {
BLOCK = crate::kind::BLOCK,
ENTITY_TYPE = crate::concatcp!(crate::kind::ENTITY, crate::sep::WORD, crate::word::TYPE),
FLUID = crate::kind::FLUID,
FUNCTION = crate::word::FUNCTION,
GAME_EVENT = "game_event",
ITEM = crate::kind::ITEM,
}
/// How data folders were named before 1.21.
data_layout {
/// What an old folder's name adds: `recipes`.
PLURAL = "s",
}
/// The game's kinds of recipe, as `.yrecipe` files name them (`type`),
/// in the order yog-registry's data has them.
recipe_kind {
SHAPED = "shaped",
SHAPELESS = "shapeless",
SMELTING = "smelting",
BLASTING = "blasting",
SMOKING = "smoking",
CAMPFIRE_COOKING = "campfire_cooking",
STONECUTTING = "stonecutting",
SMITHING = "smithing",
BREWING = "brewing",
}
/// A recipe's fields as Yog writes it (`.yrecipe`, and what the hosts get).
recipe_field {
TYPE = crate::word::TYPE,
RESULT = crate::word::RESULT,
COUNT = crate::word::COUNT,
/// A mod's kind: its slots and values, by name.
SLOTS = "slots",
VALUES = crate::word::VALUES,
/// A grid: rows of key characters, and what each character is.
PATTERN = "pattern",
KEY = crate::word::KEY,
INGREDIENTS = "ingredients",
INGREDIENT = "ingredient",
TEMPLATE = "template",
BASE = crate::word::BASE,
ADDITION = "addition",
EXPERIENCE = "experience",
COOK_TIME = "cook_time",
GROUP = "group",
CATEGORY = crate::word::CATEGORY,
}
/// The game's recipe JSON: the types Yog's kinds become, and its own fields.
game_recipe {
CRAFTING_SHAPED = crate::id!(crate::ns::MINECRAFT, "crafting_shaped"),
CRAFTING_SHAPELESS = crate::id!(crate::ns::MINECRAFT, "crafting_shapeless"),
STONECUTTING = crate::id!(crate::ns::MINECRAFT, crate::recipe_kind::STONECUTTING),
SMITHING_TRANSFORM = crate::id!(crate::ns::MINECRAFT, "smithing_transform"),
/// A cooking recipe's time.
COOKING_TIME = "cookingtime",
/// A result's item: `id` since 1.20.5, `item` before.
ID = crate::word::ID,
ITEM = crate::word::ITEM,
TAG = crate::word::TAG,
/// What a recipe makes when it says nothing.
AIR = crate::game::AIR,
}
/// Yog's chunk generator in code (`yog:callback_generator`): the hosts
/// write a dimension's JSON with it, and read it back.
callback_generator {
PATH = "callback_generator",
TYPE = crate::id!(crate::ns::YOG, PATH),
GENERATOR_TYPE_ID = "generator_type_id",
MIN_Y = "min_y",
HEIGHT = crate::word::HEIGHT,
STRUCTURES = crate::dimension_field::STRUCTURES,
FEATURES = crate::dimension_field::FEATURES,
MOB_SPAWNING = crate::dimension_field::MOB_SPAWNING,
BIOME_SOURCE = "biome_source",
}
/// The game's dimensions as a datapack writes them.
game_dimension {
DIMENSION_TYPE = crate::dimension_field::DIMENSION_TYPE,
DIMENSION = crate::word::DIMENSION,
/// A dimension's biomes: all of one.
FIXED_BIOMES = crate::id!(crate::ns::MINECRAFT, "fixed"),
/// The game's own generator and its settings, for a dimension with no generator of Yog's.
NOISE = crate::id!(crate::ns::MINECRAFT, "noise"),
OVERWORLD_NOISE = crate::game::OVERWORLD,
/// What burns forever in it.
INFINIBURN = crate::concatcp!(crate::sep::TAG, crate::id!(crate::ns::MINECRAFT, "infiniburn_overworld")),
/// Its look before 26.1 (`effects`).
EFFECTS_OVERWORLD = crate::game::OVERWORLD,
EFFECTS_END = crate::game::THE_END,
EFFECTS_NETHER = crate::game::THE_NETHER,
/// 26.x attributes: whether beds work and explode, whether respawn anchors work.
BED_RULE = crate::id!(crate::ns::MINECRAFT, "gameplay/bed_rule"),
ANCHORS_WORK = crate::id!(crate::ns::MINECRAFT, "gameplay/respawn_anchor_works"),
}
/// The tags table (yog-formats' `data/tags.txt`, copied for the hosts):
/// what its lines start with, and a tag every host has.
tag_table {
TAG = crate::kind::TAG,
YOG = crate::ns::YOG,
BASE = crate::word::BASE,
HAS = "has",
EVERYWHERE = "*",
LOADERS = "# loaders:",
}
/// The game's advancements.
advancement {
/// How one is shown: a task, a goal, a challenge.
TASK = "task",
GOAL = "goal",
CHALLENGE = "challenge",
/// What earns it: the mod's code, an item had, an item used up.
IMPOSSIBLE = crate::id!(crate::ns::MINECRAFT, "impossible"),
INVENTORY_CHANGED = crate::id!(crate::ns::MINECRAFT, "inventory_changed"),
CONSUME_ITEM = crate::id!(crate::ns::MINECRAFT, "consume_item"),
}
/// An advancement's fields: how it's shown, and in it its tab's background.
advancement_field {
DISPLAY = crate::word::DISPLAY,
BACKGROUND = "background",
}
/// The game's tool tiers' tags of what they can't mine; the weakest's.
tool_tier {
INCORRECT_FOR_WOODEN_TOOL = crate::id!(crate::ns::MINECRAFT, "incorrect_for_wooden_tool"),
}
}