diff --git a/src/types/resourcepacks/ResourcePackInfoEntry.php b/src/types/resourcepacks/ResourcePackInfoEntry.php index db24f84d..9089241d 100644 --- a/src/types/resourcepacks/ResourcePackInfoEntry.php +++ b/src/types/resourcepacks/ResourcePackInfoEntry.php @@ -27,7 +27,8 @@ public function __construct( private string $contentId = "", private bool $hasScripts = false, private bool $isAddonPack = false, - private bool $isRtxCapable = false + private bool $isRtxCapable = false, + private string $cdnUrl = "" ){} public function getPackId() : string{ @@ -64,6 +65,10 @@ public function isAddonPack(): bool{ public function isRtxCapable() : bool{ return $this->isRtxCapable; } + public function getCdnUrl(): string { + return $this->cdnUrl; + } + public function write(PacketSerializer $out) : void{ $out->putString($this->packId); $out->putString($this->version); @@ -76,6 +81,9 @@ public function write(PacketSerializer $out) : void{ $out->putBool($this->isAddonPack); } $out->putBool($this->isRtxCapable); + if($out->getProtocol() >= ProtocolInfo::PROTOCOL_748) { + $out->putString($this->cdnUrl); + } } public static function read(PacketSerializer $in) : self{ @@ -90,6 +98,7 @@ public static function read(PacketSerializer $in) : self{ $isAddonPack = $in->getBool(); } $rtxCapable = $in->getBool(); - return new self($uuid, $version, $sizeBytes, $encryptionKey, $subPackName, $contentId, $hasScripts, $isAddonPack ?? false, $rtxCapable); + $cdnUrl = $in->getProtocol() >= ProtocolInfo::PROTOCOL_748 ? $in->getString() : ""; + return new self($uuid, $version, $sizeBytes, $encryptionKey, $subPackName, $contentId, $hasScripts, $isAddonPack ?? false, $rtxCapable, $cdnUrl); } }