Documentation

Tree
in package

Table of Contents

$leafBlock  : Block
$treeHeight  : int
$trunkBlock  : Block
__construct()  : mixed
canPlaceObject()  : bool
getBlockTransaction()  : BlockTransaction|null
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
canOverride()  : bool
generateTrunkHeight()  : int
placeCanopy()  : void
placeTrunk()  : void

Properties

$treeHeight

protected int $treeHeight

Methods

__construct()

public __construct(Block $trunkBlock, Block $leafBlock[, int $treeHeight = 7 ]) : mixed
Parameters
$trunkBlock : Block
$leafBlock : Block
$treeHeight : int = 7
Return values
mixed —

canPlaceObject()

public canPlaceObject(ChunkManager $world, int $x, int $y, int $z, Random $random) : bool
Parameters
$world : ChunkManager
$x : int
$y : int
$z : int
$random : Random
Return values
bool —

getBlockTransaction()

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

public getBlockTransaction(ChunkManager $world, int $x, int $y, int $z, Random $random) : BlockTransaction|null
Parameters
$world : ChunkManager
$x : int
$y : int
$z : int
$random : Random
Return values
BlockTransaction|null —

canOverride()

protected canOverride(Block $block) : bool
Parameters
$block : Block
Return values
bool —

generateTrunkHeight()

protected generateTrunkHeight(Random $random) : int
Parameters
$random : Random
Return values
int —

placeTrunk()

protected placeTrunk(int $x, int $y, int $z, Random $random, int $trunkHeight, BlockTransaction $transaction) : void
Parameters
$x : int
$y : int
$z : int
$random : Random
$trunkHeight : int
$transaction : BlockTransaction
Return values
void —

Search results