Better recipe api and port smithing to it

This commit is contained in:
2026-11-01 19:21:40 -03:00
parent ad782839ec
commit c8b5f2a3bd
50 changed files with 371 additions and 120 deletions
+1 -2
View File
@@ -92,7 +92,7 @@ function base_categories(tags: TagApi): RecipeCategory[] {
},
},
{
type: "smithing",
type: "bworld:smithing",
title: "Smithing",
width: 108,
height: 18,
@@ -325,7 +325,6 @@ export function category_name(type: string): string {
shaped: "Crafting",
furnace: "Smelting",
fuel: "Fuel",
smithing: "Smithing",
[FISHING]: "Fishing",
[CRABPOT]: "Crab Pot",
[JUICING]: "Juicing",
+2 -2
View File
@@ -21,7 +21,7 @@ export function outputs(recipe: Recipe): Ingredient[] {
return [stack(recipe.output)];
case "fuel":
return [];
case "smithing":
case "bworld:smithing":
return [{ ids: [recipe.result], count: 1 }];
default: {
// one item or stack, or a list of them, like what a cutting board cuts something into or a press presses
@@ -58,7 +58,7 @@ export function inputs(recipe: Recipe, tags: TagApi): Ingredient[] {
return [{ ids: tags.expand(recipe.input), count: 1 }];
case "fuel":
return [{ ids: tags.expand(recipe.item), count: 1 }];
case "smithing":
case "bworld:smithing":
return [{ ids: [recipe.tool], count: 1 }, stack(recipe.material)].concat(
recipe.addition ? [{ ids: [recipe.addition], count: 1 }] : [],
);