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

Public Member Functions

 __construct ($type=Sapling::OAK)
 
 setRandomAmount ($amount)
 
 setBaseAmount ($amount)
 
 populate (ChunkManager $level, $chunkX, $chunkZ, Random $random)
 
- Public Member Functions inherited from Populator
 populate (ChunkManager $level, $chunkX, $chunkZ, Random $random)
 

Constructor & Destructor Documentation

◆ __construct()

__construct (   $type = Sapling::OAK)

Tree constructor.

Parameters
int$type
43  {
44  $this->type = $type;
45  }

Member Function Documentation

◆ populate()

populate ( ChunkManager  $level,
  $chunkX,
  $chunkZ,
Random  $random 
)
Parameters
ChunkManager$level
$chunkX
$chunkZ
Random$random
Returns
mixed|void
69  {
70  $this->level = $level;
71  $amount = $random->nextRange(0, $this->randomAmount + 1) + $this->baseAmount;
72  for($i = 0; $i < $amount; ++$i){
73  $x = $random->nextRange($chunkX << 4, ($chunkX << 4) + 15);
74  $z = $random->nextRange($chunkZ << 4, ($chunkZ << 4) + 15);
75  $y = $this->getHighestWorkableBlock($x, $z);
76  if($y === -1){
77  continue;
78  }
79  ObjectTree::growTree($this->level, $x, $y, $z, $random, $this->type);
80  }
81  }

◆ setBaseAmount()

setBaseAmount (   $amount)
Parameters
$amount
57  {
58  $this->baseAmount = $amount;
59  }

◆ setRandomAmount()

setRandomAmount (   $amount)
Parameters
$amount
50  {
51  $this->randomAmount = $amount;
52  }

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