Add some minerals
*/
- if(is_underground)
+ //if(is_underground)
+ if(some_part_underground)
{
- s16 underground_level = lowest_ground_y/MAP_BLOCKSIZE - block_y;
+ s16 underground_level = (lowest_ground_y/MAP_BLOCKSIZE - block_y)+1;
for(s16 i=0; i<underground_level*3; i++)
{
if(rand()%2 == 0)
MapNode n;
n.d = CONTENT_MESE;
- if(is_ground_content(block->getNode(cp).d))
+ //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(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);
}
light = n2.getLight();
// Make some nice difference to different sides
- if(face_dir.X == 1 || face_dir.Z == 1 || face_dir.Y == -1)
+
+ /*if(face_dir.X == 1 || face_dir.Z == 1 || face_dir.Y == -1)
light = diminish_light(diminish_light(light));
else if(face_dir.X == -1 || face_dir.Z == -1)
+ light = diminish_light(light);*/
+
+ if(face_dir.X == 1 || face_dir.X == -1 || face_dir.Y == -1)
+ light = diminish_light(diminish_light(light));
+ else if(face_dir.Z == 1 || face_dir.Z == -1)
light = diminish_light(light);
return light;
}
compress(materialdata, os, version);
- // Get and compress params
- SharedBuffer<u8> paramdata(nodecount);
+ // Get and compress lights
+ SharedBuffer<u8> lightdata(nodecount);
for(u32 i=0; i<nodecount; i++)
{
- paramdata[i] = data[i].param;
+ lightdata[i] = data[i].param;
}
- compress(paramdata, os, version);
+ compress(lightdata, os, version);
if(version >= 10)
{
assert(b.getFaceLight(p, v3s16(0,-1,0)) == 0);
// According to MapBlock::getFaceLight,
// The face on the z+ side should have double-diminished light
- assert(b.getFaceLight(p, v3s16(0,0,1)) == diminish_light(diminish_light(LIGHT_MAX)));
+ //assert(b.getFaceLight(p, v3s16(0,0,1)) == diminish_light(diminish_light(LIGHT_MAX)));
+ assert(b.getFaceLight(p, v3s16(0,0,1)) == diminish_light(LIGHT_MAX));
}
/*
Check how the block handles being in between blocks with some non-sunlight