mirror of
https://github.com/luanti-org/luanti.git
synced 2025-08-11 17:51:04 +00:00
Shorten ManualMapVoxelManipulator to MMVManip
This commit is contained in:
parent
7289d61e99
commit
2d849b0a19
18 changed files with 103 additions and 110 deletions
|
@ -30,7 +30,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
namespace treegen
|
||||
{
|
||||
|
||||
void make_tree(ManualMapVoxelManipulator &vmanip, v3s16 p0,
|
||||
void make_tree(MMVManip &vmanip, v3s16 p0,
|
||||
bool is_apple_tree, INodeDefManager *ndef, int seed)
|
||||
{
|
||||
/*
|
||||
|
@ -122,7 +122,7 @@ treegen::error spawn_ltree(ServerEnvironment *env, v3s16 p0, INodeDefManager *nd
|
|||
{
|
||||
ServerMap *map = &env->getServerMap();
|
||||
std::map<v3s16, MapBlock*> modified_blocks;
|
||||
ManualMapVoxelManipulator vmanip(map);
|
||||
MMVManip vmanip(map);
|
||||
v3s16 tree_blockp = getNodeBlockPos(p0);
|
||||
treegen::error e;
|
||||
|
||||
|
@ -151,7 +151,7 @@ treegen::error spawn_ltree(ServerEnvironment *env, v3s16 p0, INodeDefManager *nd
|
|||
}
|
||||
|
||||
//L-System tree generator
|
||||
treegen::error make_ltree(ManualMapVoxelManipulator &vmanip, v3s16 p0, INodeDefManager *ndef,
|
||||
treegen::error make_ltree(MMVManip &vmanip, v3s16 p0, INodeDefManager *ndef,
|
||||
TreeDef tree_definition)
|
||||
{
|
||||
MapNode dirtnode(ndef->getId("mapgen_dirt"));
|
||||
|
@ -414,7 +414,7 @@ treegen::error make_ltree(ManualMapVoxelManipulator &vmanip, v3s16 p0, INodeDefM
|
|||
return SUCCESS;
|
||||
}
|
||||
|
||||
void tree_node_placement(ManualMapVoxelManipulator &vmanip, v3f p0,
|
||||
void tree_node_placement(MMVManip &vmanip, v3f p0,
|
||||
MapNode node)
|
||||
{
|
||||
v3s16 p1 = v3s16(myround(p0.X),myround(p0.Y),myround(p0.Z));
|
||||
|
@ -427,7 +427,7 @@ void tree_node_placement(ManualMapVoxelManipulator &vmanip, v3f p0,
|
|||
vmanip.m_data[vmanip.m_area.index(p1)] = node;
|
||||
}
|
||||
|
||||
void tree_trunk_placement(ManualMapVoxelManipulator &vmanip, v3f p0,
|
||||
void tree_trunk_placement(MMVManip &vmanip, v3f p0,
|
||||
TreeDef &tree_definition)
|
||||
{
|
||||
v3s16 p1 = v3s16(myround(p0.X),myround(p0.Y),myround(p0.Z));
|
||||
|
@ -440,7 +440,7 @@ void tree_trunk_placement(ManualMapVoxelManipulator &vmanip, v3f p0,
|
|||
vmanip.m_data[vmanip.m_area.index(p1)] = tree_definition.trunknode;
|
||||
}
|
||||
|
||||
void tree_leaves_placement(ManualMapVoxelManipulator &vmanip, v3f p0,
|
||||
void tree_leaves_placement(MMVManip &vmanip, v3f p0,
|
||||
PseudoRandom ps ,TreeDef &tree_definition)
|
||||
{
|
||||
MapNode leavesnode=tree_definition.leavesnode;
|
||||
|
@ -452,7 +452,7 @@ void tree_leaves_placement(ManualMapVoxelManipulator &vmanip, v3f p0,
|
|||
u32 vi = vmanip.m_area.index(p1);
|
||||
if(vmanip.m_data[vi].getContent() != CONTENT_AIR
|
||||
&& vmanip.m_data[vi].getContent() != CONTENT_IGNORE)
|
||||
return;
|
||||
return;
|
||||
if (tree_definition.fruit_chance>0)
|
||||
{
|
||||
if (ps.range(1,100) > 100-tree_definition.fruit_chance)
|
||||
|
@ -464,7 +464,7 @@ void tree_leaves_placement(ManualMapVoxelManipulator &vmanip, v3f p0,
|
|||
vmanip.m_data[vmanip.m_area.index(p1)] = leavesnode;
|
||||
}
|
||||
|
||||
void tree_single_leaves_placement(ManualMapVoxelManipulator &vmanip, v3f p0,
|
||||
void tree_single_leaves_placement(MMVManip &vmanip, v3f p0,
|
||||
PseudoRandom ps, TreeDef &tree_definition)
|
||||
{
|
||||
MapNode leavesnode=tree_definition.leavesnode;
|
||||
|
@ -480,7 +480,7 @@ void tree_single_leaves_placement(ManualMapVoxelManipulator &vmanip, v3f p0,
|
|||
vmanip.m_data[vmanip.m_area.index(p1)] = leavesnode;
|
||||
}
|
||||
|
||||
void tree_fruit_placement(ManualMapVoxelManipulator &vmanip, v3f p0,
|
||||
void tree_fruit_placement(MMVManip &vmanip, v3f p0,
|
||||
TreeDef &tree_definition)
|
||||
{
|
||||
v3s16 p1 = v3s16(myround(p0.X),myround(p0.Y),myround(p0.Z));
|
||||
|
@ -560,7 +560,7 @@ void make_jungletree(VoxelManipulator &vmanip, v3s16 p0,
|
|||
v3s16 p2 = p0 + v3s16(x,-1,z);
|
||||
u32 vi1 = vmanip.m_area.index(p1);
|
||||
u32 vi2 = vmanip.m_area.index(p2);
|
||||
|
||||
|
||||
if (vmanip.m_area.contains(p2) &&
|
||||
vmanip.m_data[vi2].getContent() == CONTENT_AIR)
|
||||
vmanip.m_data[vi2] = treenode;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue