From 978b5c723e0936b11379fc18daf35b2bb87515ff Mon Sep 17 00:00:00 2001 From: Luke aka SwissalpS Date: Thu, 15 Jun 2023 03:36:58 +0200 Subject: [PATCH] new craft format: decremented_input craft.decremented_input now only holds the items. Extra parameters are dropped --- autocrafter.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/autocrafter.lua b/autocrafter.lua index bb2694b..ec79ee2 100644 --- a/autocrafter.lua +++ b/autocrafter.lua @@ -67,7 +67,6 @@ local function get_craft(pos, inventory, hash) local craft = autocrafterCache[hash] if craft then return craft end - craft = {recipe = recipe, consumption=count_index(recipe), output = output, decremented_input = decremented_input} local example_recipe = inventory:get_list("recipe") local output, decremented_input = minetest.get_craft_result({ method = "normal", width = 3, items = example_recipe @@ -77,6 +76,13 @@ local function get_craft(pos, inventory, hash) if output and not output.item:is_empty() then recipe = get_matching_craft(output.item:get_name(), example_recipe) end + + craft = { + recipe = recipe, + consumption = count_index(recipe), + output = output, + decremented_input = decremented_input.items + } autocrafterCache[hash] = craft return craft end