69 $world = $this->position->getWorld();
70 if($this->age < self::MAX_AGE){
73 BlockEventHelper::grow($this, $block,
null);
75 $grow = $this->getPlant();
76 foreach(Facing::HORIZONTAL as $side){
77 if($this->getSide($side)->hasSameTypeId($grow)){
82 $facing = Facing::HORIZONTAL[array_rand(Facing::HORIZONTAL)];
83 $side = $this->getSide($facing);
84 if($side->getTypeId() === BlockTypeIds::AIR && $side->getSide(Facing::DOWN)->hasTypeTag(BlockTypeTags::DIRT)){
85 if(BlockEventHelper::grow($side, $grow,
null)){
86 $this->position->getWorld()->setBlock($this->position, $this->setFacing($facing));