pocketmine\block\Trapdoor::recalculateBoundingBox PHP Method

recalculateBoundingBox() protected method

protected recalculateBoundingBox ( )
    protected function recalculateBoundingBox()
    {
        $damage = $this->getDamage();
        $f = 0.1875;
        if (($damage & 0x8) > 0) {
            $bb = new AxisAlignedBB($this->x, $this->y + 1 - $f, $this->z, $this->x + 1, $this->y + 1, $this->z + 1);
        } else {
            $bb = new AxisAlignedBB($this->x, $this->y, $this->z, $this->x + 1, $this->y + $f, $this->z + 1);
        }
        if (($damage & 0x4) > 0) {
            if (($damage & 0x3) === 0) {
                $bb->setBounds($this->x, $this->y, $this->z + 1 - $f, $this->x + 1, $this->y + 1, $this->z + 1);
            } elseif (($damage & 0x3) === 1) {
                $bb->setBounds($this->x, $this->y, $this->z, $this->x + 1, $this->y + 1, $this->z + $f);
            }
            if (($damage & 0x3) === 2) {
                $bb->setBounds($this->x + 1 - $f, $this->y, $this->z, $this->x + 1, $this->y + 1, $this->z + 1);
            }
            if (($damage & 0x3) === 3) {
                $bb->setBounds($this->x, $this->y, $this->z, $this->x + $f, $this->y + 1, $this->z + 1);
            }
        }
        return $bb;
    }