pocketmine\block\WoodenButton::onActivate PHP Метод

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

public onActivate ( Item $item, Player $player = null )
$item pocketmine\item\Item
$player pocketmine\Player
    public function onActivate(Item $item, Player $player = null)
    {
        if (!$this->isActivated()) {
            $this->meta ^= 0x8;
            $this->getLevel()->setBlock($this, $this, true, false);
            $this->getLevel()->addSound(new ButtonClickSound($this));
            $this->activate();
            $this->getLevel()->scheduleUpdate($this, 30);
        }
        return true;
    }