Test mod
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user