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/lighting.lua |   18 ++++++++----------
 1 files changed, 8 insertions(+), 10 deletions(-)

diff --git a/technic/machines/MV/lighting.lua b/technic/machines/MV/lighting.lua
index 76fcb20..2254ecf 100644
--- a/technic/machines/MV/lighting.lua
+++ b/technic/machines/MV/lighting.lua
@@ -45,11 +45,10 @@
         end
 end
 
-local dirs1 = {20, 23, 22, 21}
 local dirs2 = {9,  18,  7, 12}
 
 local technic_homedecor_rotate_and_place = function(itemstack, placer, pointed_thing)
-	if not technic_homedecor_node_is_owned(pointed_thing.under, placer) 
+	if not technic_homedecor_node_is_owned(pointed_thing.under, placer)
 	   and not technic_homedecor_node_is_owned(pointed_thing.above, placer) then
 		local node = minetest.get_node(pointed_thing.under)
 		if not minetest.registered_nodes[node.name] or not minetest.registered_nodes[node.name].on_rightclick then
@@ -58,7 +57,6 @@
 			local under = pointed_thing.under
 			local pitch = placer:get_look_pitch()
 			local pname = minetest.get_node(under).name
-			local node = minetest.get_node(above)
 			local fdir = minetest.dir_to_facedir(placer:get_look_dir())
 			local wield_name = itemstack:get_name()
 
@@ -76,7 +74,7 @@
 
 				if not minetest.registered_nodes[minetest.get_node(pos1).name]["buildable_to"] then return end
 
-				if iswall then 
+				if iswall then
 					minetest.add_node(pos1, {name = wield_name, param2 = dirs2[fdir+1] }) -- place wall variant
 				elseif isceiling then
 					minetest.add_node(pos1, {name = wield_name, param2 = 20 }) -- place upside down variant
@@ -159,7 +157,7 @@
 	paramtype = "light",
 	paramtype2 = "facedir",
 	walkable = true,
-	light_source = LIGHT_MAX,
+	light_source = minetest.LIGHT_MAX,
 	sounds = default.node_sound_wood_defaults(),
 
 	groups = { snappy = 3, not_in_creative_inventory=1},
@@ -240,7 +238,7 @@
 	paramtype = "light",
 	paramtype2 = "facedir",
 	walkable = true,
-	light_source = LIGHT_MAX-1,
+	light_source = minetest.LIGHT_MAX-1,
 	sounds = default.node_sound_wood_defaults(),
 
 	groups = { snappy = 3, not_in_creative_inventory=1},
@@ -322,7 +320,7 @@
 	paramtype = "light",
 	paramtype2 = "facedir",
 	walkable = true,
-	light_source = LIGHT_MAX,
+	light_source = minetest.LIGHT_MAX,
 	sounds = default.node_sound_wood_defaults(),
 
 	groups = { snappy = 3, not_in_creative_inventory=1},
@@ -403,7 +401,7 @@
 	paramtype = "light",
 	paramtype2 = "facedir",
 	walkable = true,
-	light_source = LIGHT_MAX-1,
+	light_source = minetest.LIGHT_MAX-1,
 	sounds = default.node_sound_wood_defaults(),
 
 	groups = { snappy = 3, not_in_creative_inventory=1},
@@ -484,7 +482,7 @@
 	paramtype = "light",
 	paramtype2 = "facedir",
 	walkable = true,
-	light_source = LIGHT_MAX-1,
+	light_source = minetest.LIGHT_MAX-1,
 	sounds = default.node_sound_wood_defaults(),
 
 	groups = { snappy = 3, not_in_creative_inventory=1},
@@ -565,7 +563,7 @@
 	paramtype = "light",
 	paramtype2 = "facedir",
 	walkable = true,
-	light_source = LIGHT_MAX-1,
+	light_source = minetest.LIGHT_MAX-1,
 	sounds = default.node_sound_wood_defaults(),
 
 	groups = { snappy = 3, not_in_creative_inventory=1},

--
Gitblit v1.8.0