Add cooking pot from farmer's delight !
This commit is contained in:
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user