◆ populate()
- Parameters
-
- Returns
- mixed|void
42 $chunk = $level->getChunk($chunkX, $chunkZ);
43 if($level instanceof Level or $level instanceof SimpleChunkManager){
44 $waterHeight = $level->getWaterHeight();
45 }
else $waterHeight = 0;
46 for($x = 0; $x < 16; ++$x){
47 for($z = 0; $z < 16; ++$z){
49 $cover = $biome->getGroundCover();
50 if(count($cover) > 0){
52 if(!$cover[0]->isSolid()){
56 $column = $chunk->getBlockIdColumn($x, $z);
57 for($y = 127; $y > 0; --$y){
58 if($column{$y} !==
"\x00" and !
Block::get(ord($column{$y}))->isTransparent()){
62 $startY = min(127, $y + $diffY);
63 $endY = $startY - count($cover);
64 for($y = $startY; $y > $endY and $y >= 0; --$y){
65 $b = $cover[$startY - $y];
66 if($column{$y} ===
"\x00" and $b->isSolid()){
72 if($b->getDamage() === 0){
73 $chunk->setBlockId($x, $y, $z, $b->getId());
75 $chunk->setBlock($x, $y, $z, $b->getId(), $b->getDamage());
The documentation for this class was generated from the following file:
- src/pocketmine/level/generator/populator/GroundCover.php