New effector system, effectors have to be registered with mesecon:register_effector(onstate, offstate, rules, function get_rules) rules and function get_rules are optional. You don't have to specify both onstate and offstate (required for e.g. removestone)

This commit is contained in:
Jeija
2012-08-13 20:17:45 +02:00
parent 24c50571f7
commit 00ce2540c2
14 changed files with 206 additions and 163 deletions

View File

@ -1,7 +1,7 @@
minetest.register_on_dignode(
function(pos, oldnode, digger)
if mesecon:is_conductor_on(oldnode.name) then
local i = 1
print("receptor_off")
mesecon:receptor_off(pos)
end
@ -19,7 +19,7 @@ minetest.register_on_placenode(
if mesecon:is_powered(pos) then
if mesecon:is_conductor_off(node.name) then
mesecon:turnon(pos)
mesecon:turnon(pos) -- in this case we don't need a source as the destination certainly is a conductor and not a receptor
else
mesecon:changesignal(pos)
mesecon:activate(pos)