pocketmine\block\LitRedstoneTorch::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)
    {
        $down = $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];
            $side = $faces[$face];
            $faces = [1 => 4, 2 => 5, 3 => 2, 4 => 3, 5 => 0, 6 => 0, 0 => 0];
            if ($this->getSide($faces[$side])->isCharged($this->getHash())) {
                $this->id = 75;
                $this->getLevel()->setBlock($block, $this);
                return;
            }
            $this->getLevel()->setBlock($block, $this);
            $this->BroadcastRedstoneUpdate(Level::REDSTONE_UPDATE_PLACE, Block::REDSTONESOURCEPOWER);
            return true;
        } elseif ($down->isTransparent() === false or $down instanceof Fence or $down->getId() === self::COBBLE_WALL or $down->getId() === self::GLASS || $down instanceof Slab && ($down->meta & 0x8) === 0x8 || $down instanceof WoodSlab && ($down->meta & 0x8) === 0x8 || $down instanceof Stair && ($down->meta & 0x4) === 0x4) {
            $this->meta = 0;
            if ($target->isCharged($this->getHash())) {
                $this->id = 75;
                $this->getLevel()->setBlock($block, $this);
                return;
            }
            $this->getLevel()->setBlock($block, $this);
            $this->BroadcastRedstoneUpdate(Level::REDSTONE_UPDATE_PLACE, Block::REDSTONESOURCEPOWER);
            return true;
        }
        return false;
    }