meta = $meta; } protected function recalculateBoundingBox() : ?AxisAlignedBB{ $width = 0.375; return new AxisAlignedBB( $this->x + ($this->canConnect($this->getSide(Vector3::SIDE_WEST)) ? 0 : $width), $this->y, $this->z + ($this->canConnect($this->getSide(Vector3::SIDE_NORTH)) ? 0 : $width), $this->x + 1 - ($this->canConnect($this->getSide(Vector3::SIDE_EAST)) ? 0 : $width), $this->y + 1.5, $this->z + 1 - ($this->canConnect($this->getSide(Vector3::SIDE_SOUTH)) ? 0 : $width) ); } public function canConnect(Block $block){ return $block instanceof static or $block instanceof FenceGate or ($block->isSolid() and !$block->isTransparent()); } }