From f3fbd1f75d2cfcaf62e05a545a3c5b803b194eb9 Mon Sep 17 00:00:00 2001 From: BuckarooBanzay Date: Thu, 18 Jun 2020 11:42:23 +0200 Subject: [PATCH] fix luacheck warnings --- .luacheckrc | 1 + technic/machines/LV/lamp.lua | 8 ++--- .../machines/register/extractor_recipes.lua | 10 +++--- technic/machines/switching_station.lua | 6 +--- technic_cnc/cnc_materials.lua | 34 +++++++++---------- 5 files changed, 26 insertions(+), 33 deletions(-) diff --git a/.luacheckrc b/.luacheckrc index 96a7aac..350fb8c 100644 --- a/.luacheckrc +++ b/.luacheckrc @@ -28,6 +28,7 @@ read_globals = { "protector", "isprotect", "homedecor_expect_infinite_stacks", + "monitoring" } files["concrete/init.lua"].ignore = { "steel_ingot" } diff --git a/technic/machines/LV/lamp.lua b/technic/machines/LV/lamp.lua index 5e8ee8c..609cdda 100644 --- a/technic/machines/LV/lamp.lua +++ b/technic/machines/LV/lamp.lua @@ -7,12 +7,10 @@ local S = technic.getter local illuminate = function(pos, mode) - local loc = {} --- loc.x, loc.y, loc.z = pos.x, pos.y, pos.z for y=1,3,1 do for x=-3,3,1 do for z = -3,3,1 do - loc = {x = pos.x - x, y = pos.y - y, z = pos.z - z} + local loc = {x = pos.x - x, y = pos.y - y, z = pos.z - z} if mode then if minetest.get_node(loc).name == "air" then minetest.swap_node(loc, {name = "technic:dummy_light_source"}) @@ -47,13 +45,12 @@ end local led_off = function(pos, node) local meta = minetest.get_meta(pos) - local eu_input = meta:get_int("LV_EU_input") local machine_name = S("%s LED"):format("LV") local machine_node = "technic:lv_led" technic.swap_node(pos, machine_node) meta:set_string("infotext", S("%s Unpowered"):format(machine_name)) - + meta:set_int("LV_EU_demand", 0) end @@ -80,7 +77,6 @@ end local lamp_off = function(pos, node) local meta = minetest.get_meta(pos) - local eu_input = meta:get_int("LV_EU_input") local machine_name = S("%s Lamp"):format("LV") local machine_node = "technic:lv_lamp" diff --git a/technic/machines/register/extractor_recipes.lua b/technic/machines/register/extractor_recipes.lua index 2c21974..6f8dd25 100644 --- a/technic/machines/register/extractor_recipes.lua +++ b/technic/machines/register/extractor_recipes.lua @@ -35,7 +35,7 @@ if minetest.get_modpath("dye") then if minetest.get_modpath("hunger") and minetest.get_modpath("ethereal") then table.insert(dye_recipes, {"ethereal:willow_twig 12", "technic:aspirin_pill"}) end - + if minetest.get_modpath("farming") then -- Dyes --- -- better recipes for farming's crafting methods (twice the output) @@ -50,7 +50,7 @@ if minetest.get_modpath("dye") then table.insert(dye_recipes, {"farming:blueberries", "dye:blue 4"}) table.insert(dye_recipes, {"farming:raspberries", "dye:red 4"}) end - + if minetest.get_modpath("ethereal") then table.insert(dye_recipes, {"ethereal:seaweed", "dye:dark_green 6"}) table.insert(dye_recipes, {"ethereal:coral2", "dye:cyan 6"}) @@ -61,7 +61,7 @@ if minetest.get_modpath("dye") then table.insert(dye_recipes, {"ethereal:snowygrass", "dye:grey 4"}) table.insert(dye_recipes, {"ethereal:crystalgrass", "dye:blue 4"}) end - + if minetest.get_modpath("bakedclay") then table.insert(dye_recipes, {"bakedclay:delphinium", "dye:cyan 8"}) table.insert(dye_recipes, {"bakedclay:thistle", "dye:magenta 8"}) @@ -69,12 +69,12 @@ if minetest.get_modpath("dye") then table.insert(dye_recipes, {"bakedclay:mannagrass", "dye:dark_green 8"}) end - + if minetest.get_modpath("bonemeal") then table.insert(dye_recipes, {"bonemeal:bone", "dye:white 8"}) table.insert(dye_recipes, {"bonemeal:bonemeal", "dye:white 4"}) end - + for _, data in ipairs(dye_recipes) do technic.register_extractor_recipe({input = {data[1]}, output = data[2]}) end diff --git a/technic/machines/switching_station.lua b/technic/machines/switching_station.lua index 7e42d14..7805568 100644 --- a/technic/machines/switching_station.lua +++ b/technic/machines/switching_station.lua @@ -258,12 +258,8 @@ technic.switching_station_run = function(pos) local t0 = minetest.get_us_time() local meta = minetest.get_meta(pos) - local meta1 = nil + local meta1 local pos1 = {} - local PR_EU = 0 -- EUs from PR nodes - local BA_PR_EU = 0 -- EUs from BA nodes (discharching) - local BA_RE_EU = 0 -- EUs to BA nodes (charging) - local RE_EU = 0 -- EUs to RE nodes local tier = "" local PR_nodes diff --git a/technic_cnc/cnc_materials.lua b/technic_cnc/cnc_materials.lua index 2994259..9894ebe 100644 --- a/technic_cnc/cnc_materials.lua +++ b/technic_cnc/cnc_materials.lua @@ -313,39 +313,39 @@ if minetest.get_modpath("ethereal") then {snappy=2, choppy=2, oddly_breakable_by_hand=2, not_in_creative_inventory=1}, {"crystal_block.png"}, S("Crystal")) - + -- Misc. Wood types ------------------- technic_cnc.register_all("ethereal:banana_wood", {snappy=2, choppy=2, oddly_breakable_by_hand=2, not_in_creative_inventory=1}, {"banana_wood.png"}, S("Banana Wood")) - + technic_cnc.register_all("ethereal:birch_wood", {snappy=2, choppy=2, oddly_breakable_by_hand=2, not_in_creative_inventory=1}, {"moretrees_birch_wood.png"}, S("Birch Wood")) - + technic_cnc.register_all("ethereal:frost_wood", {snappy=2, choppy=2, oddly_breakable_by_hand=2, not_in_creative_inventory=1}, {"frost_wood.png"}, S("Frost Wood")) - + technic_cnc.register_all("ethereal:palm_wood", {snappy=2, choppy=2, oddly_breakable_by_hand=2, not_in_creative_inventory=1}, {"moretrees_palm_wood.png"}, S("Palm Wood")) - + technic_cnc.register_all("ethereal:willow_wood", {snappy=2, choppy=2, oddly_breakable_by_hand=2, not_in_creative_inventory=1}, {"willow_wood.png"}, S("Willow Wood")) - + technic_cnc.register_all("ethereal:yellow_wood", {snappy=2, choppy=2, oddly_breakable_by_hand=2, not_in_creative_inventory=1}, {"yellow_wood.png"}, S("Healing Tree Wood")) - + technic_cnc.register_all("ethereal:redwood_wood", {snappy=2, choppy=2, oddly_breakable_by_hand=2, not_in_creative_inventory=1}, {"redwood_wood.png"}, @@ -360,56 +360,56 @@ if minetest.get_modpath("moreblocks") then {stone=1, cracky=3, not_in_creative_inventory=1}, {"moreblocks_stone_tile.png"}, S("Stone Tile")) - + technic_cnc.register_all("moreblocks:split_stone_tile", {stone=1, cracky=3, not_in_creative_inventory=1}, {"moreblocks_split_stone_tile.png"}, S("Split Stone Tile")) - + technic_cnc.register_all("moreblocks:checker_stone_tile", {stone=1, cracky=3, not_in_creative_inventory=1}, {"moreblocks_checker_stone_tile.png"}, S("Checker Stone Tile")) - + technic_cnc.register_all("moreblocks:cactus_checker", {stone=1, cracky=3, not_in_creative_inventory=1}, {"moreblocks_cactus_checker.png"}, S("Cactus Checker")) - + -- Bricks ------------ technic_cnc.register_all("moreblocks:cactus_brick", {cracky=3, not_in_creative_inventory=1}, {"moreblocks_cactus_brick.png"}, S("Cactus Brick")) - + technic_cnc.register_all("moreblocks:grey_bricks", {cracky=3, not_in_creative_inventory=1}, {"moreblocks_grey_bricks.png"}, S("Grey Bricks")) - + -- Metals ------------ technic_cnc.register_all("moreblocks:copperpatina", {cracky=1, level=2, not_in_creative_inventory=1}, {"moreblocks_copperpatina.png"}, S("Copper Patina")) - + -- Clay ------------ technic_cnc.register_all("bakedclay:red", {cracky=3, not_in_creative_inventory=1}, {"baked_clay_red.png"}, S("Red Clay")) - + technic_cnc.register_all("bakedclay:orange", {cracky=3, not_in_creative_inventory=1}, {"baked_clay_orange.png"}, S("Orange Clay")) - + technic_cnc.register_all("bakedclay:grey", {cracky=3, not_in_creative_inventory=1}, {"baked_clay_grey.png"}, S("Grey Clay")) - + end