Recipe viewer

This commit is contained in:
2026-09-27 01:25:47 -03:00
parent e4c9a2f7f4
commit 7f4a8719de
12 changed files with 849 additions and 13 deletions
+3
View File
@@ -44,6 +44,8 @@ export class RecipeBook {
smithing: Extract<RecipeJson, { type: "smithing" }>[] = [];
// recipes of mods' own types, by type
by_type = new Map<string, ModRecipeJson[]>();
// every recipe as its json, in load order, for recipe viewers
all: RecipeJson[] = [];
ores: OreJson[] = [];
}
@@ -81,6 +83,7 @@ export function register_mod_data(mods: { id: string; data: ModData }[]): Recipe
}
for (const recipe of data.recipes) {
recipes.all.push(recipe);
if (is_mod_recipe(recipe)) {
const list = recipes.by_type.get(recipe.type) ?? [];
recipes.by_type.set(recipe.type, list);