Skip to content

Tree ​

abstract class · pocketmine\world\generator\object\Tree · source

Properties ​

$leafBlock ​

php
public \pocketmine\block\Block $leafBlock

$treeHeight ​

php
public int $treeHeight

$trunkBlock ​

php
public \pocketmine\block\Block $trunkBlock

Methods ​

__construct() ​

php
public function __construct(\pocketmine\block\Block $trunkBlock, \pocketmine\block\Block $leafBlock, int $treeHeight = 7)

canOverride() protected ​

php
protected function canOverride(\pocketmine\block\Block $block) : bool

canPlaceObject() ​

php
public function canPlaceObject(\pocketmine\world\ChunkManager $world, int $x, int $y, int $z, \pocketmine\utils\Random $random) : bool

generateTrunkHeight() protected ​

php
protected function generateTrunkHeight(\pocketmine\utils\Random $random) : int

getBlockTransaction() ​

php
public function getBlockTransaction(\pocketmine\world\ChunkManager $world, int $x, int $y, int $z, \pocketmine\utils\Random $random) : ?\pocketmine\world\BlockTransaction

Returns the BlockTransaction containing all the blocks the tree would change upon growing at the given coordinates or null if the tree can't be grown

placeCanopy() protected ​

php
protected function placeCanopy(int $x, int $y, int $z, \pocketmine\utils\Random $random, \pocketmine\world\BlockTransaction $transaction) : void

placeTrunk() protected ​

php
protected function placeTrunk(int $x, int $y, int $z, \pocketmine\utils\Random $random, int $trunkHeight, \pocketmine\world\BlockTransaction $transaction) : void

VanillaMine is a fork of PocketMine-MP, maintained by Luxury Nodes. Not affiliated with the PMMP team or Mojang.