diff options
author | Jeija <jeija@mesecons.net> | 2014-11-22 15:42:22 +0100 |
---|---|---|
committer | Jeija <jeija@mesecons.net> | 2014-11-22 15:42:22 +0100 |
commit | 5be179bf110b44bdc06df6dbfde4e61487cf0635 (patch) | |
tree | 018eb119344d66d6229ad65607d51360fd006934 /mesecons_gates | |
parent | ffacbfde5a956da910479139f490f8ffa3ae5a85 (diff) |
Replace mesecon:<some_function> with mesecon.<some_function> for greater
flexibility and because it was never inteded to be OOP in the first
place.
mesecon.receptor_on and mesecon.receptor_off are provided by wrappers
(mesecon:receptor_on/off) for compatibility, but will be removed. Mod
programmers that use mesecons: Please update!
Also, fix microcontroller polluting the global namespace and remove some
deprecated stuff.
Diffstat (limited to 'mesecons_gates')
-rw-r--r-- | mesecons_gates/init.lua | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/mesecons_gates/init.lua b/mesecons_gates/init.lua index a22edf6..345c32c 100644 --- a/mesecons_gates/init.lua +++ b/mesecons_gates/init.lua @@ -1,6 +1,6 @@ function gate_rotate_rules(node) for rotations = 0, node.param2 - 1 do - rules = mesecon:rotate_rules_left(rules) + rules = mesecon.rotate_rules_left(rules) end return rules end @@ -53,11 +53,11 @@ function set_gate(pos, on) local node = minetest.get_node(pos) if on then minetest.swap_node(pos, {name = "mesecons_gates:"..gate.."_on", param2=node.param2}) - mesecon:receptor_on(pos, + mesecon.receptor_on(pos, gate_get_output_rules(node)) else minetest.swap_node(pos, {name = "mesecons_gates:"..gate.."_off", param2=node.param2}) - mesecon:receptor_off(pos, + mesecon.receptor_off(pos, gate_get_output_rules(node)) end end @@ -77,7 +77,7 @@ function pop_gate(pos) gate = get_gate(pos) minetest.remove_node(pos) minetest.after(0.2, function (pos) - mesecon:receptor_off(pos, mesecon.rules.flat) + mesecon.receptor_off(pos, mesecon.rules.flat) end , pos) -- wait for pending parsings minetest.add_item(pos, "mesecons_gates:"..gate.."_off") end |