35 use StaticSupportTrait;
40 $id = $block->getTypeId();
41 if($id !== BlockTypeIds::END_STONE && $id !== BlockTypeIds::CHORUS_FLOWER && !$block->hasSameTypeId($this)){
42 $bb->trim($facing, 2 / 16);
49 private function canBeSupportedBy(Block $block) : bool{
50 return $block->hasSameTypeId($this) || $block->getTypeId() === BlockTypeIds::END_STONE;
53 private function canBeSupportedAt(Block $block) : bool{
54 $position = $block->position;
55 $world = $position->getWorld();
57 $down = $world->getBlock($position->down());
58 $verticalAir = $down->getTypeId() === BlockTypeIds::AIR || $world->getBlock($position->up())->getTypeId() === BlockTypeIds::AIR;
60 foreach($position->sidesAroundAxis(Axis::Y) as $sidePosition){
61 $block = $world->getBlock($sidePosition);
63 if($block->getTypeId() === BlockTypeIds::CHORUS_PLANT){
68 if($this->canBeSupportedBy($block->getSide(Facing::DOWN))){
74 return $this->canBeSupportedBy($down);
78 if(mt_rand(0, 1) === 1){
79 return [VanillaItems::CHORUS_FRUIT()];