resource packs: added new option remove_client_resources, fixed client packs being removed when forcing resource pack download

This commit is contained in:
Dylan K. Taylor
2020-01-04 13:16:47 +00:00
parent ee08286eca
commit 06ec8b8397
4 changed files with 24 additions and 4 deletions

View File

@ -35,7 +35,7 @@ class ResourcePackStackPacket extends DataPacket{
public const NETWORK_ID = ProtocolInfo::RESOURCE_PACK_STACK_PACKET;
/** @var bool */
public $mustAccept = false;
public $removeClientResourcePacks = false;
/** @var ResourcePack[] */
public $behaviorPackStack = [];
@ -48,7 +48,7 @@ class ResourcePackStackPacket extends DataPacket{
public $baseGameVersion = ProtocolInfo::MINECRAFT_VERSION_NETWORK;
protected function decodePayload(){
$this->mustAccept = $this->getBool();
$this->removeClientResourcePacks = $this->getBool();
$behaviorPackCount = $this->getUnsignedVarInt();
while($behaviorPackCount-- > 0){
$this->getString();
@ -68,7 +68,7 @@ class ResourcePackStackPacket extends DataPacket{
}
protected function encodePayload(){
$this->putBool($this->mustAccept);
$this->putBool($this->removeClientResourcePacks);
$this->putUnsignedVarInt(count($this->behaviorPackStack));
foreach($this->behaviorPackStack as $entry){