예제 #1
0
 public function addParticle(Particle $particle, array $players = null)
 {
     $pk = $particle->encode();
     if ($players === null) {
         if ($pk !== null) {
             if (!is_array($pk)) {
                 $this->addChunkPacket($particle->x >> 4, $particle->z >> 4, $pk);
             } else {
                 foreach ($pk as $e) {
                     $this->addChunkPacket($particle->x >> 4, $particle->z >> 4, $e);
                 }
             }
         }
     } else {
         if ($pk !== null) {
             if (!is_array($pk)) {
                 Server::broadcastPacket($players, $pk);
             } else {
                 $this->server->batchPackets($players, $pk, false);
             }
         }
     }
 }