diff options
author | TenPlus1 <kinsellaja@yahoo.com> | 2016-01-09 12:25:33 +0000 |
---|---|---|
committer | TenPlus1 <kinsellaja@yahoo.com> | 2016-01-09 12:25:33 +0000 |
commit | ad7b63b86971ccae7b1abc008196c9e9553b54ec (patch) | |
tree | 05fe8e2a0ea0e9b8d4939cffaed46e6abb0cf9f4 /water.lua | |
parent | 94873618b17859a6f3cc9c3a02dcc88b511075cf (diff) |
Optimize and tidy code.
Diffstat (limited to 'water.lua')
-rw-r--r-- | water.lua | 18 |
1 files changed, 9 insertions, 9 deletions
@@ -47,7 +47,7 @@ minetest.register_abm({ chance = 100, catch_up = false, action = function(pos, node) - minetest.set_node(pos, {name = "default:mossycobble"}) + minetest.swap_node(pos, {name = "default:mossycobble"}) end }) @@ -68,7 +68,7 @@ minetest.register_abm({ {"default:water_source", "default:river_water_source"}) if water and #water > 0 then - minetest.set_node(water[1], {name = "default:ice"}) + minetest.swap_node(water[1], {name = "default:ice"}) end end, }) @@ -97,11 +97,11 @@ minetest.register_abm({ or node.name == "default:snowblock" or node.name == "ethereal:icebrick" or node.name == "ethereal:snowbrick" then - minetest.set_node(pos, {name = water_node.."_source"}) + minetest.swap_node(pos, {name = water_node.."_source"}) elseif node.name == "default:snow" then - minetest.set_node(pos, {name = water_node.."_flowing"}) + minetest.swap_node(pos, {name = water_node.."_flowing"}) elseif node.name == "default:dirt_with_snow" then - minetest.set_node(pos, {name = "default:dirt_with_grass"}) + minetest.swap_node(pos, {name = "default:dirt_with_grass"}) end nodeupdate(pos) @@ -117,9 +117,9 @@ minetest.register_abm({ catch_up = false, action = function(pos, node) if node == "ethereal:dry_dirt" then - minetest.set_node(pos, {name = "default:dirt"}) + minetest.swap_node(pos, {name = "default:dirt"}) else - minetest.set_node(pos, {name = "ethereal:green_dirt"}) + minetest.swap_node(pos, {name = "ethereal:green_dirt"}) end end, }) @@ -145,8 +145,8 @@ minetest.register_abm({ {x = pos.x, y = pos.y + 1, z = pos.z}, {"group:water"}) if num > 0 then - minetest.set_node(pos, {name = "default:water_flowing"}) + minetest.swap_node(pos, {name = "default:water_flowing"}) minetest.add_item(pos, {name = node.name}) end end, -})
\ No newline at end of file +}) |