From 53f91d4f47b0b752569edbd8f196ef95c576fec2 Mon Sep 17 00:00:00 2001 From: "Vega Nicholas S." Date: Wed, 4 Dec 2024 07:35:40 +0700 Subject: [PATCH] fix: Version 1.21.0 - 1.21.20 not handled --- .../network/packets/ResourcePacksInfoPacket.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/Supero/NightfallProtocol/network/packets/ResourcePacksInfoPacket.php b/src/Supero/NightfallProtocol/network/packets/ResourcePacksInfoPacket.php index f38c195..f01a8c6 100644 --- a/src/Supero/NightfallProtocol/network/packets/ResourcePacksInfoPacket.php +++ b/src/Supero/NightfallProtocol/network/packets/ResourcePacksInfoPacket.php @@ -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(); @@ -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(); @@ -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);