Recipe types from shared scripts and stuff

This commit is contained in:
2026-11-01 20:41:23 -03:00
parent c8b5f2a3bd
commit 65113862f7
34 changed files with 234 additions and 134 deletions
+14 -4
View File
@@ -78,12 +78,16 @@ Deno.test("the recipe viewer finds what makes and uses an item, in any recipe ty
const served_in_bowls = using("bworld:bowl").map((r) => outputs(r)[0].ids[0]);
assert(served_in_bowls.includes("bworld:cooked_rice"));
assert(served_in_bowls.includes("bworld:tomato_sauce"));
assert(using("bworld:coal").some((r) => r.type === "fuel"));
assert(using("bworld:coal").some((r) => r.type === "bworld:fuel"));
assert(using("bworld:coal").some((r) => r.type === "shaped" && outputs(r)[0].ids[0] === "bworld:stove"));
assert(using("bworld:potato").includes(rolls));
// smelting and smithing
assert(using("bworld:iron_ore").some((r) => r.type === "furnace" && outputs(r)[0].ids[0] === "bworld:iron_ingot"));
assert(
using("bworld:iron_ore").some((r) =>
r.type === "bworld:smelting" && outputs(r)[0].ids[0] === "bworld:iron_ingot"
),
);
assertEquals(ids(inputs(making("bworld:stone_pickaxe")[0])), ["bworld:wood_pickaxe", "bworld:stone"]);
assertEquals(category_name("bworld:smithing"), "Smithing");
});
@@ -104,8 +108,14 @@ Deno.test("recipes are found by category in jei's order, and a catalyst's uses a
{ category, recipes },
) => [category.type, recipes]);
const all = game.recipes.all;
assertEquals(furnace_uses.find(([type]) => type === "furnace")?.[1], all.filter((r) => r.type === "furnace"));
assertEquals(furnace_uses.find(([type]) => type === "fuel")?.[1], all.filter((r) => r.type === "fuel"));
assertEquals(
furnace_uses.find(([type]) => type === "bworld:smelting")?.[1],
all.filter((r) => r.type === "bworld:smelting"),
);
assertEquals(
furnace_uses.find(([type]) => type === "bworld:fuel")?.[1],
all.filter((r) => r.type === "bworld:fuel"),
);
assertEquals(index.find(item("bworld:air"), "recipes"), []);
});