summaryrefslogtreecommitdiff
path: root/mesecons_battery
diff options
context:
space:
mode:
authorJeija <norrepli@gmail.com>2012-08-13 20:17:45 +0200
committerJeija <norrepli@gmail.com>2012-08-13 20:17:45 +0200
commit00ce2540c22340ed02135d74c6d70a35757e8deb (patch)
tree24f5ee80cf20e3eb2a9a303a52ead63ff685fecd /mesecons_battery
parent24c50571f788a2d946ee905dd295124affc88d8b (diff)
downloadmesecons-00ce2540c22340ed02135d74c6d70a35757e8deb.tar
mesecons-00ce2540c22340ed02135d74c6d70a35757e8deb.tar.gz
mesecons-00ce2540c22340ed02135d74c6d70a35757e8deb.tar.bz2
mesecons-00ce2540c22340ed02135d74c6d70a35757e8deb.tar.xz
mesecons-00ce2540c22340ed02135d74c6d70a35757e8deb.zip
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)
Diffstat (limited to 'mesecons_battery')
-rw-r--r--mesecons_battery/init.lua6
1 files changed, 3 insertions, 3 deletions
diff --git a/mesecons_battery/init.lua b/mesecons_battery/init.lua
index b5e50a9..1218778 100644
--- a/mesecons_battery/init.lua
+++ b/mesecons_battery/init.lua
@@ -19,10 +19,9 @@ for i = 1, 5 do
type = "fixed",
fixed = {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5},
},
- groups = {dig_immediate=2, mesecon = 2, mesecon_effector_on = 1},
+ groups = {dig_immediate=2, mesecon = 2},
description="Battery",
})
- mesecon:add_receptor_node_off("mesecons_battery:battery_charging_"..i)
end
for i = 1, 5 do
@@ -46,10 +45,11 @@ for i = 1, 5 do
type = "fixed",
fixed = {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5},
},
- groups = {dig_immediate=2, not_in_creative_inventory=1, mesecon = 2, mesecon_effector_off = 1},
+ groups = {dig_immediate=2, not_in_creative_inventory=1, mesecon = 2},
description="Battery",
})
mesecon:add_receptor_node("mesecons_battery:battery_discharging_"..i)
+ mesecon:register_effector("mesecons_battery:battery_discharging_"..i, "mesecons_battery:battery_charging_"..i)
end
minetest.register_on_placenode(function (pos, newnode, placer)