Add cooking pot from farmer's delight !

This commit is contained in:
2026-09-27 01:08:50 -03:00
parent 52587aabf7
commit e4c9a2f7f4
43 changed files with 913 additions and 10 deletions
+10
View File
@@ -5,8 +5,10 @@ import {
BlockJson,
grid_recipe_from_json,
GridRecipe,
is_mod_recipe,
item_from_json,
ItemJson,
ModRecipeJson,
OreJson,
RecipeJson,
} from "./mod_data.ts";
@@ -40,6 +42,8 @@ export class RecipeBook {
furnace = new Map<string, { output: { id: string; count: number }; cook_time: number }>();
fuel = new Map<string, number>();
smithing: Extract<RecipeJson, { type: "smithing" }>[] = [];
// recipes of mods' own types, by type
by_type = new Map<string, ModRecipeJson[]>();
ores: OreJson[] = [];
}
@@ -77,6 +81,12 @@ export function register_mod_data(mods: { id: string; data: ModData }[]): Recipe
}
for (const recipe of data.recipes) {
if (is_mod_recipe(recipe)) {
const list = recipes.by_type.get(recipe.type) ?? [];
recipes.by_type.set(recipe.type, list);
list.push(recipe);
continue;
}
switch (recipe.type) {
case "shaped":
recipes.shaped.push(grid_recipe_from_json(recipe));