This commit is contained in:
2026-09-24 23:28:01 -03:00
parent 79faa556de
commit bb42dd662e
73 changed files with 2349 additions and 34 deletions
+2 -2
View File
@@ -8,7 +8,7 @@ export interface CraftingRecipe {
result: { id: string; count: number };
}
const recipes: CraftingRecipe[] = [
export const CRAFTING_RECIPES: CraftingRecipe[] = [
{
width: 3,
height: 3,
@@ -117,7 +117,7 @@ function matches_recipe(grid: (string | undefined)[], recipe: CraftingRecipe): b
// puts what the grid makes in the result slot
export function update_crafting_result(crafting: Container) {
const grid = get_crafting_grid(crafting);
const recipe = recipes.find((recipe) => matches_recipe(grid, recipe));
const recipe = CRAFTING_RECIPES.find((recipe) => matches_recipe(grid, recipe));
crafting.set_item(CRAFTING_RESULT_SLOT, recipe ? new ItemStack(recipe.result.id, recipe.result.count) : undefined);
}