pocketmine\block\PoweredRepeater::onUpdate PHP Method

onUpdate() public method

public onUpdate ( $type )
    public function onUpdate($type)
    {
        if ($type == Level::BLOCK_UPDATE_SCHEDULED) {
            if ($this->getLevel()->getBlockTempData($this) == self::ACTION_ACTIVATE) {
                $this->activateBlock($this->getSide($this->getOppositeDirection()));
                $this->activateBlock($this->getSide(Vector3::SIDE_DOWN, 2));
            } elseif ($this->getLevel()->getBlockTempData($this) == self::ACTION_DEACTIVATE) {
                $this->deactivateImmediately();
            }
            $this->getLevel()->setBlockTempData($this);
        }
        return $type;
    }