Pressure plates and the object detector will send power to vertical

wires 2 nodes below them, allows to hide circuitry powered by them.
Fixes #179
Rewrite pressure plates + vertical wires using mesecon.register_node.
This commit is contained in:
Jeija
2014-11-22 12:28:45 +01:00
parent 194155fff8
commit b5cc933287
6 changed files with 93 additions and 144 deletions

View File

@ -47,15 +47,14 @@ mesecon.queue.funcs={} -- contains all ActionQueue functions
-- Settings
dofile(minetest.get_modpath("mesecons").."/settings.lua")
-- Presets (eg default rules)
dofile(minetest.get_modpath("mesecons").."/presets.lua");
-- Utilities like comparing positions,
-- adding positions and rules,
-- mostly things that make the source look cleaner
dofile(minetest.get_modpath("mesecons").."/util.lua");
-- Presets (eg default rules)
dofile(minetest.get_modpath("mesecons").."/presets.lua");
-- The ActionQueue
-- Saves all the actions that have to be execute in the future
dofile(minetest.get_modpath("mesecons").."/actionqueue.lua");

View File

@ -15,6 +15,9 @@ mesecon.rules.default =
{x=0, y=1, z=-1},
{x=0, y=-1, z=-1}}
mesecon.rules.pplate = {{x=0, y=-2, z=0}}
mesecon.mergetable(mesecon.rules.default, mesecon.rules.pplate)
mesecon.rules.buttonlike =
{{x = 1, y = 0, z = 0},
{x = 1, y = 1, z = 0},

View File

@ -199,6 +199,9 @@ mesecon.mergetable = function(source, dest)
for k, v in pairs(source) do
dest[k] = dest[k] or v
end
for i, v in ipairs(source) do
dest[i] = dest[i] or v
end
end
mesecon.register_node = function(name, spec_common, spec_off, spec_on)