summaryrefslogtreecommitdiff
path: root/mesecons_movestones
diff options
context:
space:
mode:
authorJeija <jeija@mesecons.net>2014-11-22 22:09:26 +0100
committerJeija <jeija@mesecons.net>2014-11-22 22:09:26 +0100
commitf977ac821aa2f6c7053ec7f65d289c57de1e91a8 (patch)
tree2d025fd6483e1ac3e4c409a356d2015aada00778 /mesecons_movestones
parent80d136125ef8f17af85d0045800d5e761ace3229 (diff)
downloadmesecons-f977ac821aa2f6c7053ec7f65d289c57de1e91a8.tar
mesecons-f977ac821aa2f6c7053ec7f65d289c57de1e91a8.tar.gz
mesecons-f977ac821aa2f6c7053ec7f65d289c57de1e91a8.tar.bz2
mesecons-f977ac821aa2f6c7053ec7f65d289c57de1e91a8.tar.xz
mesecons-f977ac821aa2f6c7053ec7f65d289c57de1e91a8.zip
Re-implement settings system:
Settings can now be retrieved by mesecon.setting(<name>, <default>) and can be modified without editing the source code by adding the setting to minetest.conf For instance, you can add mesecon.blinky_plant_interval = 0.5 to minetest.conf in order to increase the blinking speed. Rewrite the blinky plant with nodetimers. Fixes #161
Diffstat (limited to 'mesecons_movestones')
-rw-r--r--mesecons_movestones/init.lua5
1 files changed, 3 insertions, 2 deletions
diff --git a/mesecons_movestones/init.lua b/mesecons_movestones/init.lua
index 96d417a..dcbb00b 100644
--- a/mesecons_movestones/init.lua
+++ b/mesecons_movestones/init.lua
@@ -91,13 +91,14 @@ minetest.register_entity("mesecons_movestones:movestone_entity", {
pos.x, pos.y, pos.z = math.floor(pos.x+0.5), math.floor(pos.y+0.5), math.floor(pos.z+0.5)
local direction = mesecon.get_movestone_direction(pos)
+ local maxpush = mesecon.setting("movestone_max_push", 50)
if not direction then -- no mesecon power
--push only solid nodes
local name = minetest.get_node(pos).name
if name ~= "air" and name ~= "ignore"
and ((not minetest.registered_nodes[name])
or minetest.registered_nodes[name].liquidtype == "none") then
- mesecon.mvps_push(pos, self.lastdir, MOVESTONE_MAXIMUM_PUSH)
+ mesecon.mvps_push(pos, self.lastdir, maxpush)
end
minetest.add_node(pos, {name="mesecons_movestones:movestone"})
self.object:remove()
@@ -105,7 +106,7 @@ minetest.register_entity("mesecons_movestones:movestone_entity", {
end
local success, stack, oldstack =
- mesecon.mvps_push(pos, direction, MOVESTONE_MAXIMUM_PUSH)
+ mesecon.mvps_push(pos, direction, maxpush)
if not success then -- Too large stack/stopper in the way
minetest.add_node(pos, {name="mesecons_movestones:movestone"})
self.object:remove()