onOpen() public method

public onOpen ( Player $who )
$who pocketmine\Player
 public function onOpen(Player $who)
 {
     parent::onOpen($who);
     if (count($this->getViewers()) === 1) {
         $pk = new BlockEventPacket();
         $pk->x = $this->right->getHolder()->getX();
         $pk->y = $this->right->getHolder()->getY();
         $pk->z = $this->right->getHolder()->getZ();
         $pk->case1 = 1;
         $pk->case2 = 2;
         if (($level = $this->right->getHolder()->getLevel()) instanceof Level) {
             $level->addChunkPacket($this->right->getHolder()->getX() >> 4, $this->right->getHolder()->getZ() >> 4, $pk);
         }
     }
 }
 public function onOpen(Player $who)
 {
     parent::onOpen($who);
     if (\count($this->getViewers()) === 1) {
         $pk = new TileEventPacket();
         $pk->x = $this->right->getHolder()->getX();
         $pk->y = $this->right->getHolder()->getY();
         $pk->z = $this->right->getHolder()->getZ();
         $pk->case1 = 1;
         $pk->case2 = 2;
         if (($level = $this->right->getHolder()->getLevel()) instanceof Level) {
             Server::broadcastPacket($level->getUsingChunk($this->right->getHolder()->getX() >> 4, $this->right->getHolder()->getZ() >> 4), $pk->setChannel(Network::CHANNEL_WORLD_EVENTS));
         }
     }
 }