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

Public Member Functions

 canPlaceObject (ChunkManager $level, $x, $y, $z, Random $random)
 
- Public Member Functions inherited from Tree
 canPlaceObject (ChunkManager $level, $x, $y, $z, Random $random)
 
 placeObject (ChunkManager $level, $x, $y, $z, Random $random)
 

Data Fields

 $overridable
 
- Data Fields inherited from Tree
 $overridable
 
 $type = 0
 
 $trunkBlock = Block::LOG
 
 $leafBlock = Block::LEAVES
 
 $treeHeight = 7
 
 $leafType = 0
 

Additional Inherited Members

- Static Public Member Functions inherited from Tree
static growTree (ChunkManager $level, $x, $y, $z, Random $random, $type=0, bool $noBigTree=true)
 
- Protected Member Functions inherited from Tree
 placeTrunk (ChunkManager $level, $x, $y, $z, Random $random, $trunkHeight)
 

Member Function Documentation

◆ canPlaceObject()

canPlaceObject ( ChunkManager  $level,
  $x,
  $y,
  $z,
Random  $random 
)
Parameters
ChunkManager$level
$x
$y
$z
Random$random
Returns
bool
59  {
60  if(!parent::canPlaceObject($level, $x, $y, $z, $random) or $level->getBlockIdAt($x, $y, $z) == Block::WATER or $level->getBlockIdAt($x, $y, $z) == Block::STILL_WATER){
61  return false;
62  }
63  $base = new Vector3($x, $y, $z);
64  $this->totalHeight = $this->baseHeight + $random->nextBoundedInt(12);
65  $availableSpace = $this->getAvailableBlockSpace($level, $base, $base->add(0, $this->totalHeight - 1, 0));
66  if($availableSpace > $this->baseHeight or $availableSpace == -1){
67  if($availableSpace != -1){
68  $this->totalHeight = $availableSpace;
69  }
70  return true;
71  }
72  return false;
73  }

Field Documentation

◆ $overridable

$overridable
Initial value:
= [
Block::AIR => true

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