From 149491a06b978dd418f1d2d8eacfbcf833bc30c5 Mon Sep 17 00:00:00 2001 From: Luke aka SwissalpS Date: Thu, 15 Jun 2023 03:33:46 +0200 Subject: [PATCH] indentation adjusting --- autocrafter.lua | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/autocrafter.lua b/autocrafter.lua index 5fb3b9e..01563d2 100644 --- a/autocrafter.lua +++ b/autocrafter.lua @@ -65,17 +65,19 @@ end local function get_craft(pos, inventory, hash) local hash = hash or minetest.hash_node_position(pos) local craft = autocrafterCache[hash] - local example_recipe = inventory:get_list("recipe") - local output, decremented_input = minetest.get_craft_result({method = "normal", width = 3, items = example_recipe}) - local recipe = example_recipe - if output and not output.item:is_empty() then recipe = minetest.get_craft_recipe(output.item:get_name()).items or example_recipe - end if craft then return craft end craft = {recipe = recipe, consumption=count_index(recipe), output = output, decremented_input = decremented_input} - autocrafterCache[hash] = craft + local example_recipe = inventory:get_list("recipe") + local output, decremented_input = minetest.get_craft_result({ + method = "normal", width = 3, items = example_recipe + }) + + local recipe = example_recipe + if output and not output.item:is_empty() then end + autocrafterCache[hash] = craft return craft end