From 1084ca00da9fed82e9aade561a0e2a437f0f89b6 Mon Sep 17 00:00:00 2001 From: SFENCE Date: Fri, 26 Mar 2021 22:12:45 +0100 Subject: [PATCH] Fix .luacheckrc, fix unused index variable, remove spaces, use tabs. --- .luacheckrc | 2 ++ technic/machines/register/recipes.lua | 44 +++++++++++++-------------- 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/.luacheckrc b/.luacheckrc index 96a7aac..6f932ad 100644 --- a/.luacheckrc +++ b/.luacheckrc @@ -28,6 +28,8 @@ read_globals = { "protector", "isprotect", "homedecor_expect_infinite_stacks", + + "craftguide", } files["concrete/init.lua"].ignore = { "steel_ingot" } diff --git a/technic/machines/register/recipes.lua b/technic/machines/register/recipes.lua index 3723ecf..5d328e3 100644 --- a/technic/machines/register/recipes.lua +++ b/technic/machines/register/recipes.lua @@ -17,10 +17,8 @@ function technic.register_recipe_type(typename, origdata) if have_cg and craftguide.register_craft_type and data.output_size == 1 then craftguide.register_craft_type(typename, { description = data.description, - --width = data.input_size, - --height = 1, }) - end + end data.recipes = {} technic.recipes[typename] = data end @@ -68,26 +66,26 @@ local function register_recipe(typename, data) }) end if have_cg and technic.recipes[typename].output_size == 1 then - if craftguide.register_craft then - local result = data.output; - if (type(result)=="table") then - result = result[1]; - end - local items = ""; - for index, input in pairs(data.input) do - if (items=="") then - items = items..input; - else - items = items..", "..input; - end - end - craftguide.register_craft({ - type = typename, - result = result, - items = {items}, - }) - end - end + if craftguide.register_craft then + local result = data.output; + if (type(result)=="table") then + result = result[1]; + end + local items = ""; + for _, input in pairs(data.input) do + if (items=="") then + items = items..input; + else + items = items..", "..input; + end + end + craftguide.register_craft({ + type = typename, + result = result, + items = {items}, + }) + end + end end function technic.register_recipe(typename, data)