feat: add new crafting recipes for cobblestone and stone variants; enhance auto-crafting logic for excess items

This commit is contained in:
MayaTheShy
2026-03-25 18:11:23 -04:00
parent f327f82677
commit 1606d60a06
5 changed files with 203 additions and 9 deletions

View File

@@ -245,4 +245,22 @@ function recipeBook.count()
return cc, sc
end
--- Find all crafting recipes that use a given item as an ingredient.
-- @param ingredientName string — the input item to search for
-- @return array of recipe tables
function recipeBook.findRecipesUsing(ingredientName)
local results = {}
for _, recipe in pairs(recipes.crafting) do
if recipe.grid then
for _, item in ipairs(recipe.grid) do
if item == ingredientName then
table.insert(results, recipe)
break
end
end
end
end
return results
end
return recipeBook