-#if 0
-/*
- This is a quick-hand function for calling makeBlock().
-*/
-MapBlock * ServerMap::generateBlock(
- v3s16 p,
- std::map<v3s16, MapBlock*> &modified_blocks
-)
-{
- bool enable_mapgen_debug_info = g_settings->getBool("enable_mapgen_debug_info");
-
- TimeTaker timer("generateBlock");
-
- //MapBlock *block = original_dummy;
-
- v2s16 p2d(p.X, p.Z);
- v2s16 p2d_nodes = p2d * MAP_BLOCKSIZE;
-
- /*
- Do not generate over-limit
- */
- if(blockpos_over_limit(p))
- {
- infostream<<FUNCTION_NAME<<": Block position over limit"<<std::endl;
- throw InvalidPositionException("generateBlock(): pos. over limit");
- }
-
- /*
- Create block make data
- */
- BlockMakeData data;
- initBlockMake(&data, p);
-
- /*
- Generate block
- */
- {
- TimeTaker t("mapgen::make_block()");
- mapgen->makeChunk(&data);
- //mapgen::make_block(&data);
-
- if(enable_mapgen_debug_info == false)
- t.stop(true); // Hide output
- }
-
- /*
- Blit data back on map, update lighting, add mobs and whatever this does
- */
- finishBlockMake(&data, modified_blocks);
-
- /*
- Get central block
- */
- MapBlock *block = getBlockNoCreateNoEx(p);
-
-#if 0
- /*
- Check result
- */
- if(block)
- {
- bool erroneus_content = false;
- for(s16 z0=0; z0<MAP_BLOCKSIZE; z0++)
- for(s16 y0=0; y0<MAP_BLOCKSIZE; y0++)
- for(s16 x0=0; x0<MAP_BLOCKSIZE; x0++)
- {
- v3s16 p(x0,y0,z0);
- MapNode n = block->getNode(p);
- if(n.getContent() == CONTENT_IGNORE)
- {
- infostream<<"CONTENT_IGNORE at "
- <<"("<<p.X<<","<<p.Y<<","<<p.Z<<")"
- <<std::endl;
- erroneus_content = true;
- assert(0);
- }
- }
- if(erroneus_content)
- {
- assert(0);
- }
- }
-#endif
-
-#if 0
- /*
- Generate a completely empty block
- */
- if(block)
- {
- for(s16 z0=0; z0<MAP_BLOCKSIZE; z0++)
- for(s16 x0=0; x0<MAP_BLOCKSIZE; x0++)
- {
- for(s16 y0=0; y0<MAP_BLOCKSIZE; y0++)
- {
- MapNode n;
- n.setContent(CONTENT_AIR);
- block->setNode(v3s16(x0,y0,z0), n);
- }
- }
- }
-#endif
-
- if(enable_mapgen_debug_info == false)
- timer.stop(true); // Hide output
-
- return block;
-}
-#endif
-