pocketmine\block\RedstoneTorch::place PHP Метод

place() публичный Метод

public place ( Item $item, Block $block, Block $target, $face, $fx, $fy, $fz, Player $player = null )
$item pocketmine\item\Item
$block Block
$target Block
$player pocketmine\Player
    public function place(Item $item, Block $block, Block $target, $face, $fx, $fy, $fz, Player $player = null)
    {
        $below = $this->getSide(0);
        if ($target->isTransparent() === false and $face !== 0) {
            $faces = [1 => 5, 2 => 4, 3 => 3, 4 => 2, 5 => 1];
            $this->meta = $faces[$face];
            $this->getLevel()->setBlock($block, $this, true, true);
            return true;
        } elseif ($below->isTransparent() === false or $below->getId() === self::FENCE or $below->getId() === self::COBBLE_WALL or $below->getId() == Block::INACTIVE_REDSTONE_LAMP or $below->getId() == Block::ACTIVE_REDSTONE_LAMP) {
            $this->meta = 0;
            $this->getLevel()->setBlock($block, $this, true, true);
            return true;
        }
        return false;
    }