Split conductors into their own mod

This commit is contained in:
Carter Kolwey 2016-08-23 00:20:46 -05:00
parent a3042b44fc
commit 89214caa1c
4 changed files with 13 additions and 6 deletions

View File

@ -132,8 +132,5 @@ print("[OK] Mesecons")
-- To be removed in future releases
dofile(minetest.get_modpath("mesecons").."/legacy.lua");
--The actual wires
dofile(minetest.get_modpath("mesecons").."/wires.lua");
--Services like turnoff receptor on dignode and so on
dofile(minetest.get_modpath("mesecons").."/services.lua");

View File

@ -1,5 +1,14 @@
-- Dig and place services
-- Stub to "fake" updating conductors if not installed
-- If it is installed, that mod handles these
if not minetest.get_modpath("mesecons_conductors") then
mesecon.update_autoconnect = function()
return
end
mesecon.queue:add_function("update_autoconnect", mesecon.update_autoconnect)
end
mesecon.on_placenode = function (pos, node)
mesecon.update_autoconnect(pos, node)
@ -61,8 +70,6 @@ mesecon.on_dignode = function (pos, node)
mesecon.queue:add_action(pos, "update_autoconnect", {node})
end
mesecon.queue:add_function("update_autoconnect", mesecon.update_autoconnect)
minetest.register_on_placenode(mesecon.on_placenode)
minetest.register_on_dignode(mesecon.on_dignode)

View File

@ -0,0 +1 @@
mesecons

View File

@ -96,6 +96,8 @@ function mesecon.update_autoconnect(pos, node)
update_on_place_dig(pos, node)
end
mesecon.queue:add_function("update_autoconnect", mesecon.update_autoconnect)
-- ############################
-- ## Wire node registration ##
-- ############################
@ -204,7 +206,7 @@ register_wires = function()
groups_off["not_in_creative_inventory"] = 1
end
mesecon.register_node("mesecons:wire_"..nodeid, {
mesecon.register_node(":mesecons:wire_"..nodeid, {
description = "Mesecon",
drawtype = "nodebox",
inventory_image = "mesecons_wire_inv.png",