MCPcopy Create free account
hub / github.com/cuberite/cuberite / UpdateHeightmap

Method UpdateHeightmap

src/Generating/ChunkDesc.cpp:567–586  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

565
566
567void cChunkDesc::UpdateHeightmap(void)
568{
569 for (int x = 0; x < cChunkDef::Width; x++)
570 {
571 for (int z = 0; z < cChunkDef::Width; z++)
572 {
573 int Height = 0;
574 for (int y = cChunkDef::Height - 1; y > 0; y--)
575 {
576 BLOCKTYPE BlockType = GetBlockType(x, y, z);
577 if (BlockType != E_BLOCK_AIR)
578 {
579 Height = y;
580 break;
581 }
582 } // for y
583 SetHeight(x, z, Height);
584 } // for z
585 } // for x
586}
587
588
589

Callers 2

DoGenerateMethod · 0.45
GenFinishMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected