93 $this->position->getWorld()->dropItem($this->position, $this->asItem());
96 $this->position->getWorld()->setBlock($this->position, $this->setBerries(
false));
100 $newState = (clone $this)
102 ->setHead(!$this->getSide(Facing::DOWN)->hasSameTypeId($this));
103 if(BlockEventHelper::grow($this, $newState, $player)){
112 $head = !$this->getSide(
Facing::DOWN)->hasSameTypeId($this);
113 if($head !== $this->head){
114 $this->position->getWorld()->setBlock($this->position, $this->setHead($head));
117 if($this->age < self::MAX_AGE && mt_rand(1, 10) === 1){
118 $growthPos = $this->position->getSide(Facing::DOWN);
119 $world = $growthPos->getWorld();
120 if($world->isInWorld($growthPos->getFloorX(), $growthPos->getFloorY(), $growthPos->getFloorZ())){
121 $block = $world->getBlock($growthPos);
122 if($block->
getTypeId() === BlockTypeIds::AIR){
123 $newState = VanillaBlocks::CAVE_VINES()
124 ->setAge($this->age + 1)
125 ->setBerries(mt_rand(1, 9) === 1);
126 BlockEventHelper::grow($block, $newState,
null);