pocketmine\entity\Minecart::getCurrentRail PHP Method

getCurrentRail() private method

private getCurrentRail ( )
    private function getCurrentRail()
    {
        $block = $this->getLevel()->getBlock($this);
        if ($this->isRail($block)) {
            return $block;
        }
        // Rail could be one block below descending down
        $down = $this->temporalVector->setComponents($this->x, $this->y - 1, $this->z);
        $block = $this->getLevel()->getBlock($down);
        if ($this->isRail($block)) {
            return $block;
        }
        return null;
    }