pocketmine\block\RedstoneTorch::deactivateTorch PHP Method

deactivateTorch() public method

public deactivateTorch ( array $ignore = [], array $notCheck = [] )
$ignore array
$notCheck array
    public function deactivateTorch(array $ignore = [], array $notCheck = [])
    {
        if ($this->canCalc()) {
            $this->activated = false;
            /** @var Door $block */
            $sides = [Vector3::SIDE_EAST, Vector3::SIDE_WEST, Vector3::SIDE_SOUTH, Vector3::SIDE_NORTH];
            foreach ($sides as $side) {
                if (!in_array($side, $ignore)) {
                    $block = $this->getSide($side);
                    if (!in_array($hash = Level::blockHash($block->x, $block->y, $block->z), $notCheck)) {
                        $this->deactivateBlock($block);
                    }
                }
            }
            if (!in_array(Vector3::SIDE_DOWN, $ignore)) {
                $block = $this->getSide(Vector3::SIDE_DOWN);
                if (!in_array($hash = Level::blockHash($block->x, $block->y, $block->z), $notCheck)) {
                    if (!$this->checkPower($block)) {
                        /** @var $block ActiveRedstoneLamp */
                        if ($block->getId() == Block::ACTIVE_REDSTONE_LAMP) {
                            $block->turnOff();
                        }
                    }
                    $block = $this->getSide(Vector3::SIDE_DOWN, 2);
                    $this->deactivateBlock($block);
                }
            }
            //$this->lastUpdateTime = $this->getLevel()->getServer()->getTick();
        }
    }