Always use best compression for chunks

This commit is contained in:
Dylan K. Taylor 2017-09-30 20:30:24 +01:00
parent 9cd7f39c03
commit 42dd9d6abd

View File

@ -42,11 +42,8 @@ class ChunkRequestTask extends AsyncTask{
protected $tiles; protected $tiles;
protected $compressionLevel;
public function __construct(Level $level, Chunk $chunk){ public function __construct(Level $level, Chunk $chunk){
$this->levelId = $level->getId(); $this->levelId = $level->getId();
$this->compressionLevel = $level->getServer()->networkCompressionLevel;
$this->chunk = $chunk->fastSerialize(); $this->chunk = $chunk->fastSerialize();
$this->chunkX = $chunk->getX(); $this->chunkX = $chunk->getX();
@ -75,7 +72,7 @@ class ChunkRequestTask extends AsyncTask{
$batch = new BatchPacket(); $batch = new BatchPacket();
$batch->addPacket($pk); $batch->addPacket($pk);
$batch->setCompressionLevel($this->compressionLevel); $batch->setCompressionLevel(9);
$batch->encode(); $batch->encode();
$this->setResult($batch->buffer, false); $this->setResult($batch->buffer, false);