mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-15 17:35:37 +02:00
Add core.spawn_tree_on_vmanip
(#15415)
This function works like `core.spawn_tree`, but spawns an L-system tree onto a VoxelManip object instead on the map.
This commit is contained in:
@@ -875,4 +875,15 @@ void make_pine_tree(MMVManip &vmanip, v3s16 p0, const NodeDefManager *ndef,
|
||||
}
|
||||
}
|
||||
|
||||
std::string error_to_string(error e)
|
||||
{
|
||||
switch (e) {
|
||||
case SUCCESS:
|
||||
return "success";
|
||||
case UNBALANCED_BRACKETS:
|
||||
return "closing ']' has no matching opening bracket";
|
||||
}
|
||||
return "unknown error";
|
||||
}
|
||||
|
||||
}; // namespace treegen
|
||||
|
@@ -68,4 +68,7 @@ namespace treegen {
|
||||
treegen::error make_ltree(MMVManip &vmanip, v3s16 p0, const TreeDef &def);
|
||||
// Helper to spawn it directly on map
|
||||
treegen::error spawn_ltree(ServerMap *map, v3s16 p0, const TreeDef &def);
|
||||
|
||||
// Helper to get a string from the error message
|
||||
std::string error_to_string(error e);
|
||||
}; // namespace treegen
|
||||
|
Reference in New Issue
Block a user