Recipe viewer
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user