g_settings.setDefault("height_base", "linear 0 0 0");
g_settings.setDefault("plants_amount", "1.0");
g_settings.setDefault("ravines_amount", "1.0");
+ g_settings.setDefault("coal_amount", "1.0");
+
g_settings.setDefault("objectdata_interval", "0.2");
g_settings.setDefault("active_object_range", "2");
g_settings.setDefault("max_simultaneous_block_sends_per_client", "1");
if(some_part_underground)
{
s16 underground_level = (lowest_ground_y/MAP_BLOCKSIZE - block_y)+1;
+
+ /*
+ Add meseblocks
+ */
for(s16 i=0; i<underground_level*1; i++)
{
if(rand()%2 == 0)
}
}
- if(rand()%3 == 0)
+ /*
+ Add coal
+ */
+ u16 coal_amount = 30.0 * g_settings.getFloat("coal_amount");
+ u16 coal_rareness = 60 / coal_amount;
+ if(coal_rareness == 0)
+ coal_rareness = 1;
+ if(rand()%coal_rareness == 0)
{
- for(s16 i=0; i<20; i++)
+ for(s16 i=0; i<coal_amount; i++)
{
v3s16 cp(
(rand()%(MAP_BLOCKSIZE-2))+1,
<<std::endl;*/
{
v3s16 p2 = p + v3s16(x,y,z-2);
- if(is_ground_content(sector->getNode(p2).d))
+ if(is_ground_content(sector->getNode(p2).d)
+ && !is_mineral(sector->getNode(p2).d))
sector->setNode(p2, n);
}
{
v3s16 p2 = p + v3s16(x,y,z-1);
- if(is_ground_content(sector->getNode(p2).d))
+ if(is_ground_content(sector->getNode(p2).d)
+ && !is_mineral(sector->getNode(p2).d))
sector->setNode(p2, n2);
}
{
v3s16 p2 = p + v3s16(x,y,z+0);
- if(is_ground_content(sector->getNode(p2).d))
+ if(is_ground_content(sector->getNode(p2).d)
+ && !is_mineral(sector->getNode(p2).d))
sector->setNode(p2, n2);
}
{
v3s16 p2 = p + v3s16(x,y,z+1);
- if(is_ground_content(sector->getNode(p2).d))
+ if(is_ground_content(sector->getNode(p2).d)
+ && !is_mineral(sector->getNode(p2).d))
sector->setNode(p2, n);
}
m == CONTENT_GRASS ||
m == CONTENT_GRASS_FOOTSTEPS ||
m == CONTENT_MESE ||
- m == CONTENT_MUD
+ m == CONTENT_MUD ||
+ m == CONTENT_COALSTONE
);
}
+inline bool is_mineral(u8 c)
+{
+ return(c == CONTENT_MESE
+ || c == CONTENT_COALSTONE);
+}
+
/*inline bool content_has_faces(u8 c)
{
return (m != CONTENT_IGNORE
// Port?
u16 port = 30000;
- if(cmd_args.exists("port"))
+ if(cmd_args.exists("port") && cmd_args.getU16("port") != 0)
{
port = cmd_args.getU16("port");
}
- else if(g_settings.exists("port"))
+ else if(g_settings.exists("port") && g_settings.getU16("port") != 0)
{
port = g_settings.getU16("port");
}