SpruceTree
extends 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
$leafBlock
protected
Block
$leafBlock
$treeHeight
protected
int
$treeHeight
$trunkBlock
protected
Block
$trunkBlock
Methods
__construct()
public
__construct() : mixed
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 —placeCanopy()
protected
placeCanopy(int $x, int $y, int $z, Random $random, BlockTransaction $transaction) : void
Parameters
- $x : int
- $y : int
- $z : int
- $random : Random
- $transaction : BlockTransaction
Return values
void —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