treegen::error make_ltree(MMVManip &vmanip, v3s16 p0,
const NodeDefManager *ndef, TreeDef tree_definition)
{
- MapNode dirtnode(ndef->getId("mapgen_dirt"));
- if (dirtnode == CONTENT_IGNORE)
- errorstream << "Treegen (make_ltree): Mapgen alias 'mapgen_dirt' is invalid!" << std::endl;
-
s32 seed;
if (tree_definition.explicit_seed)
seed = tree_definition.seed + 14002;
axiom = temp;
}
- //make sure tree is not floating in the air
+ // Add trunk nodes below a wide trunk to avoid gaps when tree is on sloping ground
if (tree_definition.trunk_type == "double") {
- tree_node_placement(
+ tree_trunk_placement(
vmanip,
v3f(position.X + 1, position.Y - 1, position.Z),
- dirtnode
+ tree_definition
);
- tree_node_placement(
+ tree_trunk_placement(
vmanip,
v3f(position.X, position.Y - 1, position.Z + 1),
- dirtnode
+ tree_definition
);
- tree_node_placement(
+ tree_trunk_placement(
vmanip,
v3f(position.X + 1, position.Y - 1, position.Z + 1),
- dirtnode
+ tree_definition
);
} else if (tree_definition.trunk_type == "crossed") {
- tree_node_placement(
+ tree_trunk_placement(
vmanip,
v3f(position.X + 1, position.Y - 1, position.Z),
- dirtnode
+ tree_definition
);
- tree_node_placement(
+ tree_trunk_placement(
vmanip,
v3f(position.X - 1, position.Y - 1, position.Z),
- dirtnode
+ tree_definition
);
- tree_node_placement(
+ tree_trunk_placement(
vmanip,
v3f(position.X, position.Y - 1, position.Z + 1),
- dirtnode
+ tree_definition
);
- tree_node_placement(
+ tree_trunk_placement(
vmanip,
v3f(position.X, position.Y - 1, position.Z - 1),
- dirtnode
+ tree_definition
);
}
!tree_definition.thin_branches)) {
tree_trunk_placement(
vmanip,
- v3f(position.X +1 , position.Y, position.Z),
+ v3f(position.X + 1, position.Y, position.Z),
tree_definition
);
tree_trunk_placement(