1
0
mirror of https://github.com/mt-mods/plantlife_modpack.git synced 2025-07-15 22:30:43 +02:00

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

@ -18,9 +18,9 @@ abstract_dryplants.grow_juncus = function(pos)
if minetest.get_node(right_here).name == "air" -- instead of check_air = true,
or minetest.get_node(right_here).name == "default:junglegrass" then
if juncus_type == 2 then
minetest.set_node(right_here, {name="dryplants:juncus_02"})
minetest.swap_node(right_here, {name="dryplants:juncus_02"})
else
minetest.set_node(right_here, {name="dryplants:juncus"})
minetest.swap_node(right_here, {name="dryplants:juncus"})
end
end
end
@ -57,9 +57,9 @@ minetest.register_node("dryplants:juncus", {
local juncus_type = math.random(2,3)
local right_here = {x=pos.x, y=pos.y+1, z=pos.z}
if juncus_type == 2 then
minetest.set_node(right_here, {name="dryplants:juncus_02"})
minetest.swap_node(right_here, {name="dryplants:juncus_02"})
else
minetest.set_node(right_here, {name="dryplants:juncus"})
minetest.swap_node(right_here, {name="dryplants:juncus"})
end
if not minetest.setting_getbool("creative_mode") then
itemstack:take_item()