From 438c0877f6ed03a25211ce70e2edd26b01703a8c Mon Sep 17 00:00:00 2001
From: KaylebJay <44441970+KaylebJay@users.noreply.github.com>
Date: Wed, 24 Jun 2020 21:12:25 +0200
Subject: [PATCH] Add external machine registration support (#557)

---
 technic/machines/MV/power_radiator.lua |   24 ++++++++++++------------
 1 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/technic/machines/MV/power_radiator.lua b/technic/machines/MV/power_radiator.lua
index 6523471..a5d2ed6 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
@@ -135,21 +145,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 +177,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