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 /dirt.lua | |
parent | 94873618b17859a6f3cc9c3a02dcc88b511075cf (diff) |
Optimize and tidy code.
Diffstat (limited to 'dirt.lua')
-rw-r--r-- | dirt.lua | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -42,7 +42,7 @@ dirt.type = { {"Crystal"}, {"Mushroom"}, {"Fiery"}, {"Gray"}, } -for _, row in ipairs(dirt.type) do +for _, row in pairs(dirt.type) do local desc = row[1] local name = desc:lower() @@ -89,7 +89,7 @@ minetest.register_abm({ "group:ethereal_grass") local n -- count new grass nodes - for _,p in ipairs(positions) do + for _,p in pairs(positions) do n = minetest.get_node_or_nil(p) if n and n.name then count_grasses[n.name] = (count_grasses[n.name] or 0) + 1 @@ -100,7 +100,7 @@ minetest.register_abm({ end end end - minetest.set_node(pos, {name = curr_type}) + minetest.swap_node(pos, {name = curr_type}) end }) @@ -125,7 +125,7 @@ minetest.register_abm({ if name ~= "ignore" and nodedef and not ((nodedef.sunlight_propagates or nodedef.paramtype == "light") and nodedef.liquidtype == "none") then - minetest.set_node(pos, {name = "default:dirt"}) + minetest.swap_node(pos, {name = "default:dirt"}) end end }) |