Skip to content

Commit

Permalink
fix: Version 1.21.0 - 1.21.20 not handled
Browse files Browse the repository at this point in the history
  • Loading branch information
nicholass003 committed Dec 4, 2024
1 parent ed40c8b commit 53f91d4
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ protected function decodePayload(PacketSerializer $in) : void{
if($in->getProtocol() >= CustomProtocolInfo::PROTOCOL_1_20_70){
$this->hasAddons = $in->getBool();
}
$this->hasAddons = $in->getBool();
$this->hasScripts = $in->getBool();
if($in->getProtocol() <= CustomProtocolInfo::PROTOCOL_1_21_20){
$this->forceServerPacks = $in->getBool();
Expand All @@ -74,7 +73,7 @@ protected function decodePayload(PacketSerializer $in) : void{
$this->resourcePackEntries[] = CustomResourcePackInfoEntry::read($in);
}

if($in->getProtocol() >= CustomProtocolInfo::PROTOCOL_1_21_30 && $in->getProtocol() < CustomProtocolInfo::PROTOCOL_1_21_40){
if($in->getProtocol() >= CustomProtocolInfo::PROTOCOL_1_21_0 && $in->getProtocol() < CustomProtocolInfo::PROTOCOL_1_21_40){
$this->cdnUrls = [];
for($i = 0, $count = $in->getUnsignedVarInt(); $i < $count; $i++){
$packId = $in->getString();
Expand All @@ -101,7 +100,7 @@ protected function encodePayload(PacketSerializer $out) : void{
foreach($this->resourcePackEntries as $entry){
$entry->write($out);
}
if($out->getProtocol() >= CustomProtocolInfo::PROTOCOL_1_21_30 && $out->getProtocol() < CustomProtocolInfo::PROTOCOL_1_21_40){
if($out->getProtocol() >= CustomProtocolInfo::PROTOCOL_1_21_0 && $out->getProtocol() < CustomProtocolInfo::PROTOCOL_1_21_40){
$out->putUnsignedVarInt(count($this->cdnUrls));
foreach($this->cdnUrls as $packId => $cdnUrl){
$out->putString($packId);
Expand Down

0 comments on commit 53f91d4

Please sign in to comment.