Juices on the mechanical press !

This commit is contained in:
2026-10-31 00:03:03 -03:00
parent 3734f5707a
commit 23d02c5229
11 changed files with 381 additions and 62 deletions
+8 -2
View File
@@ -38,6 +38,7 @@ const MOD_CATALYSTS: Record<string, string[]> = {
"farmersdelight:cooking": ["farmersdelight:cooking_pot"],
"farmersdelight:cutting": ["farmersdelight:cutting_board"],
"create:pressing": ["create:mechanical_press"],
"create:compacting": ["create:mechanical_press", "create:basin"],
};
// the base game's, in the order their tabs go, like jei's vanilla plugin
@@ -293,8 +294,13 @@ function mod_category(type: string, tags: TagApi): RecipeCategory {
);
layout.texture("bworld:arrow_full", 61, 19, ARROW, ARROW);
extras.slice(0, 1).forEach((ingredient) => layout.slot(ingredient, 60, 36, ["Served in"]));
const made = outputs(recipe).slice(0, 3);
made.forEach((output, i) => layout.slot(output, 94, made.length > 1 ? i * SLOT : SLOT));
// items, then fluids, down the right
const made = [...outputs(recipe), ...fluid_outputs(recipe)].slice(0, 3);
made.forEach((output, i) => {
const y = made.length > 1 ? i * SLOT : SLOT;
if ("fluid" in output) layout.fluid(output.fluid, output.amount, 94, y);
else layout.slot(output, 94, y);
});
if (typeof recipe.cook_time === "number") layout.text(seconds(recipe.cook_time), 84, 45);
},
};
+4 -3
View File
@@ -35,10 +35,11 @@ export function outputs(recipe: Recipe): Ingredient[] {
}
}
// the fluids a recipe makes and takes, from its "fluid_results" and "fluid_ingredients", which the viewer's own recipe
// types use, like juicing
// the fluids a recipe makes and takes, from its "fluid_results" and "fluid_ingredients", like juicing, and the
// { fluid, amount } among its "results", like create's
export function fluid_outputs(recipe: Recipe): FluidAmount[] {
return recipe.fluid_results ?? [];
const among = Array.isArray(recipe.results) ? recipe.results.filter((result: Recipe) => result?.fluid) : [];
return [...recipe.fluid_results ?? [], ...among];
}
export function fluid_inputs(recipe: Recipe): FluidAmount[] {