pocketmine\block\Lever::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)
    {
        if ($target->isTransparent() === false) {
            $faces = [3 => 3, 2 => 4, 4 => 2, 5 => 1];
            if ($face === 0) {
                $to = $player instanceof Player ? $player->getDirection() : 0;
                $this->meta = $to % 2 != 1 ? 0 : 7;
            } elseif ($face === 1) {
                $to = $player instanceof Player ? $player->getDirection() : 0;
                $this->meta = $to % 2 != 1 ? 6 : 5;
            } else {
                $this->meta = $faces[$face];
            }
            $this->getLevel()->setBlock($block, $this, true, false);
            return true;
        }
        return false;
    }