If param2 of the node is ~= 0, the node will always be preserved. Thus, if
the player places a node of that kind, you will want to set param2=1 or so.
+The function default.after_place_leaves can be set as after_place_node of a node
+to set param2 to 1 if the player places the node (should not be used for nodes
+that use param2 otherwise (e.g. facedir)).
+
If the node is in the leafdecay_drop group then it will always be dropped as an
item.
math.floor(dtime * finds_per_second)
end)
+default.after_place_leaves = function(pos, placer, itemstack, pointed_thing)
+ local node = minetest.get_node(pos)
+ node.param2 = 1
+ minetest.set_node(pos, node)
+end
+
minetest.register_abm({
nodenames = {"group:leafdecay"},
neighbors = {"air", "group:liquid"},
}
},
sounds = default.node_sound_leaves_defaults(),
+ after_place_node = default.after_place_leaves,
})
minetest.register_node("default:junglesapling", {
}
},
sounds = default.node_sound_leaves_defaults(),
+ after_place_node = default.after_place_leaves,
})
minetest.register_node("default:cactus", {
}
},
sounds = default.node_sound_leaves_defaults(),
+ after_place_node = default.after_place_leaves,
})
minetest.register_node("default:pine_sapling", {