diff options
author | TenPlus1 <kinsellaja@yahoo.com> | 2015-11-27 09:19:32 +0000 |
---|---|---|
committer | TenPlus1 <kinsellaja@yahoo.com> | 2015-11-27 09:19:32 +0000 |
commit | 4f3f8b2c3a4994a2d320ca26da937c850002ea17 (patch) | |
tree | cf2f57408137b0d808e15b7e7794f47268ba1bac /water.lua | |
parent | 4a29cc936a239800b5db0bf9b16114ff172666cc (diff) |
Ice or snow above sea level melts into river water
Diffstat (limited to 'water.lua')
-rw-r--r-- | water.lua | 15 |
1 files changed, 11 insertions, 4 deletions
@@ -86,17 +86,24 @@ minetest.register_abm({ interval = 5, chance = 4, catch_up = false, - action = function(pos, node, active_object_count, active_object_count_wider) + action = function(pos, node) + + local water_node = "default:water" + if pos.y > 2 then + water_node = "default:river_water" + end + if node.name == "default:ice" or node.name == "default:snowblock" or node.name == "ethereal:icebrick" or node.name == "ethereal:snowbrick" then - minetest.set_node(pos, {name = "default:water_source"}) + minetest.set_node(pos, {name = water_node.."_source"}) elseif node.name == "default:snow" then - minetest.set_node(pos, {name = "default:water_flowing"}) + minetest.set_node(pos, {name = water_node.."_flowing"}) elseif node.name == "default:dirt_with_snow" then minetest.set_node(pos, {name = "default:dirt_with_grass"}) end + nodeupdate(pos) end, }) @@ -108,7 +115,7 @@ minetest.register_abm({ interval = 15, chance = 2, catch_up = false, - action = function(pos, node, active_object_count, active_object_count_wider) + action = function(pos, node) if node == "ethereal:dry_dirt" then minetest.set_node(pos, {name = "default:dirt"}) else |