pocketmine\level\particle\Particle::encode PHP Method

encode() abstract public method

abstract public encode ( ) : DataPacket | DataPacket[]
return pocketmine\network\protocol\DataPacket | pocketmine\network\protocol\DataPacket[]
    public abstract function encode();

Usage Example

Exemplo n.º 1
0
 public function addParticle(Particle $particle, array $players = null)
 {
     $pk = $particle->encode();
     if ($players === null) {
         $players = $this->getUsingChunk($particle->x >> 4, $particle->z >> 4);
     }
     if ($pk !== null) {
         if (!is_array($pk)) {
             Server::broadcastPacket($players, $pk->setChannel(Network::CHANNEL_WORLD_EVENTS));
         } else {
             $this->server->batchPackets($players, $pk, false, Network::CHANNEL_WORLD_EVENTS);
         }
     }
 }
All Usage Examples Of pocketmine\level\particle\Particle::encode
Particle