GenisysPro  for Minecraft PE/Windows 10 v1.1.x
Feature-rich server software for Minecraft PE and Windows 10 Edition
Ore Class Reference

Public Member Functions

 populate (ChunkManager $level, $chunkX, $chunkZ, Random $random)
 
 setOreTypes (array $types)
 
- Public Member Functions inherited from Populator
 populate (ChunkManager $level, $chunkX, $chunkZ, Random $random)
 

Member Function Documentation

◆ populate()

populate ( ChunkManager  $level,
  $chunkX,
  $chunkZ,
Random  $random 
)
Parameters
ChunkManager$level
$chunkX
$chunkZ
Random$random
Returns
mixed|void
39  {
40  foreach($this->oreTypes as $type){
41  $ore = new ObjectOre($random, $type);
42  for($i = 0; $i < $ore->type->clusterCount; ++$i){
43  $x = $random->nextRange($chunkX << 4, ($chunkX << 4) + 15);
44  $y = $random->nextRange($ore->type->minHeight, $ore->type->maxHeight);
45  $z = $random->nextRange($chunkZ << 4, ($chunkZ << 4) + 15);
46  if($ore->canPlaceObject($level, $x, $y, $z)){
47  $ore->placeObject($level, $x, $y, $z);
48  }
49  }
50  }
51  }

◆ setOreTypes()

setOreTypes ( array  $types)
Parameters
array$types
56  {
57  $this->oreTypes = $types;
58  }

The documentation for this class was generated from the following file: