use swap_node() where possible, for speed

This commit is contained in:
Vanessa Dannenberg
2018-10-25 10:27:54 -04:00
parent 2c7a776c7f
commit 77093e428a
22 changed files with 156 additions and 156 deletions

View File

@ -9,7 +9,7 @@ local function spawn_apple_under(pos)
z = pos.z,
}
if minetest.get_node(below).name == "air" then
minetest.set_node(below, { name = "default:apple" })
minetest.swap_node(below, { name = "default:apple" })
end
end

View File

@ -67,7 +67,7 @@ function nature:grow_node(pos, nodename)
>= nature.minimum_growth_light
if is_not_young(pos) and light_enough then
minetest.set_node(pos, { name = nodename })
minetest.swap_node(pos, { name = nodename })
set_young_node(pos)
minetest.log("info", nodename .. " has grown at " .. pos.x .. ","