Пример #1
0
 public function populate(ChunkManager $level, $chunkX, $chunkZ, Random $random)
 {
     $this->level = $level;
     $type = new OreType(new Glowstone(), 1, 20, 128, 10);
     $ore = new ObjectOre($random, $type);
     for ($i = 0; $i < $ore->type->clusterCount; ++$i) {
         $x = $random->nextRange($chunkX << 4, ($chunkX << 4) + 15);
         $z = $random->nextRange($chunkZ << 4, ($chunkZ << 4) + 15);
         $y = $this->getHighestWorkableBlock($x, $z);
         $ore->placeObject($level, $x, $y, $z);
     }
 }