Skip to content

Compressor ​

interface · pocketmine\network\mcpe\compression\Compressor · source

Methods ​

compress() ​

php
public function compress(string $payload) : string

decompress() ​

php
public function decompress(string $payload) : string

getCompressionThreshold() ​

php
public function getCompressionThreshold() : ?int

Returns the minimum size of packet batch that the compressor will attempt to compress.

The compressor's output MUST still be valid input for the decompressor even if the compressor input is below this threshold. However, it may choose to use a cheaper compression option (e.g. zlib level 0, which simply wraps the data and doesn't attempt to compress it) to avoid wasting CPU time.

getNetworkId() ​

php
public function getNetworkId() : int

Returns the canonical ID of this compressor, used to tell the remote end how to decompress a packet compressed with this compressor.

VanillaMine is a fork of PocketMine-MP, maintained by Luxury Nodes. Not affiliated with the PMMP team or Mojang.