1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

crafting system!

This commit is contained in:
Perttu Ahola 2010-12-22 16:30:23 +02:00
parent 2e41a5e304
commit 3de176cc58
22 changed files with 703 additions and 143 deletions

View file

@ -1947,11 +1947,10 @@ MapBlock * ServerMap::emergeBlock(
Add some minerals
*/
//if(is_underground)
if(some_part_underground)
{
s16 underground_level = (lowest_ground_y/MAP_BLOCKSIZE - block_y)+1;
for(s16 i=0; i<underground_level*3; i++)
for(s16 i=0; i<underground_level*1; i++)
{
if(rand()%2 == 0)
{
@ -1978,6 +1977,36 @@ MapBlock * ServerMap::emergeBlock(
}
}
}
if(rand()%3 == 0)
{
for(s16 i=0; i<20; i++)
{
v3s16 cp(
(rand()%(MAP_BLOCKSIZE-2))+1,
(rand()%(MAP_BLOCKSIZE-2))+1,
(rand()%(MAP_BLOCKSIZE-2))+1
);
MapNode n;
n.d = CONTENT_COALSTONE;
//dstream<<"Adding coalstone"<<std::endl;
//if(is_ground_content(block->getNode(cp).d))
if(block->getNode(cp).d == CONTENT_STONE)
if(rand()%8 == 0)
block->setNode(cp, n);
for(u16 i=0; i<26; i++)
{
//if(is_ground_content(block->getNode(cp+g_26dirs[i]).d))
if(block->getNode(cp+g_26dirs[i]).d == CONTENT_STONE)
if(rand()%8 == 0)
block->setNode(cp+g_26dirs[i], n);
}
}
}
}
/*