public function onOpen(Player $who) { parent::onOpen($who); if (count($this->getViewers()) === 1) { $pk = new TileEventPacket(); $pk->x = $this->main->getFakeTile()->x; $pk->y = $this->main->getFakeTile()->y; $pk->z = $this->main->getFakeTile()->z; $pk->case1 = 1; $pk->case2 = 2; if (($level = $this->main->getFakeTile()->getLevel()) instanceof Level) { Server::broadcastPacket($level->getChunkPlayers($this->main->getFakeTile()->x >> 4, $this->main->getFakeTile()->z >> 4), $pk->setChannel(Network::CHANNEL_WORLD_EVENTS)); } } }