Added resource packs support

This commit is contained in:
Dylan K. Taylor
2017-03-10 20:00:31 +00:00
parent 1f2b584400
commit d41bdfc31c
12 changed files with 370 additions and 40 deletions

View File

@ -31,26 +31,26 @@ class ResourcePackDataInfoPacket extends DataPacket{
const NETWORK_ID = ProtocolInfo::RESOURCE_PACK_DATA_INFO_PACKET;
public $packId;
public $int1;
public $int2;
public $packSize;
public $unknown;
public $maxChunkSize;
public $chunkCount;
public $compressedPackSize;
public $sha256;
public function decode(){
$this->packId = $this->getString();
$this->int1 = $this->getLInt();
$this->int2 = $this->getLInt();
$this->packSize = $this->getLLong();
$this->unknown = $this->getString();
$this->maxChunkSize = $this->getLInt();
$this->chunkCount = $this->getLInt();
$this->compressedPackSize = $this->getLLong();
$this->sha256 = $this->getString();
}
public function encode(){
$this->reset();
$this->putString($this->packId);
$this->putLInt($this->int1);
$this->putLInt($this->int2);
$this->putLLong($this->packSize);
$this->putString($this->unknown);
$this->putLInt($this->maxChunkSize);
$this->putLInt($this->chunkCount);
$this->putLLong($this->compressedPackSize);
$this->putString($this->sha256);
}
public function handle(NetworkSession $session) : bool{