From 0f6bdb1bde5f476b8e4500cba559f813cd5276a1 Mon Sep 17 00:00:00 2001
From: SmallJoker <mk939@ymail.com>
Date: Mon, 06 Jun 2022 21:04:13 +0200
Subject: [PATCH] Correct (almost) all luacheck warnings

---
 technic/machines/MV/power_radiator.lua |   27 ++++++++++++++-------------
 1 files changed, 14 insertions(+), 13 deletions(-)

diff --git a/technic/machines/MV/power_radiator.lua b/technic/machines/MV/power_radiator.lua
index 6523471..329f055 100644
--- a/technic/machines/MV/power_radiator.lua
+++ b/technic/machines/MV/power_radiator.lua
@@ -12,6 +12,16 @@
 
 local power_radius = 12
 
+
+minetest.register_craft({
+	output = 'technic:power_radiator 1',
+	recipe = {
+		{'technic:stainless_steel_ingot', 'technic:mv_transformer', 'technic:stainless_steel_ingot'},
+		{'technic:copper_coil',           'technic:machine_casing', 'technic:copper_coil'},
+		{'technic:rubber',                'technic:mv_cable',       'technic:rubber'},
+	}
+})
+
 ------------------------------------------------------------------
 -- API for inductive powered nodes:
 -- Use the functions below to set the corresponding callbacks
@@ -26,7 +36,8 @@
 end
 
 -- Appliances:
---  has_supply: pos of supply node if the appliance has a power radiator near with sufficient power for the demand else ""
+--  has_supply: pos of supply node if the appliance has a power radiator near
+--              with sufficient power for the demand else ""
 --  EU_demand: The power demand of the device.
 --  EU_charge: Actual use. set to EU_demand if active==1
 --  active: set to 1 if the device is on
@@ -135,21 +146,13 @@
 	end
 })
 
-minetest.register_craft({
-	output = 'technic:power_radiator 1',
-	recipe = {
-		{'technic:stainless_steel_ingot', 'technic:stainless_steel_ingot', 'technic:stainless_steel_ingot'},
-		{'technic:copper_coil',           'technic:mv_transformer',        'technic:copper_coil'},
-		{'technic:rubber',                'technic:mv_cable0',       'technic:rubber'},
-	}
-})
-
 minetest.register_abm({
+	label = "Machines: run power radiator",
 	nodenames = {"technic:power_radiator"},
 	interval   = 1,
 	chance     = 1,
 	action = function(pos, node, active_object_count, active_object_count_wider)
-		local meta             = minetest.env:get_meta(pos)
+		local meta             = minetest.get_meta(pos)
 		local eu_input  = meta:get_int("MV_EU_input")
 		local eu_demand = meta:get_int("MV_EU_demand")
 
@@ -175,8 +178,6 @@
 			-- The supply radius
 			local rad = power_radius
 
-			local meta1            = nil
-			local pos1             = {}
 			local used_charge      = 0
 
 			-- Index all nodes within supply range

--
Gitblit v1.8.0