13declare(strict_types=1);
15namespace pocketmine\network\mcpe\protocol;
23 public const NETWORK_ID = ProtocolInfo::NETWORK_CHUNK_PUBLISHER_UPDATE_PACKET;
28 public array $savedChunks = [];
30 public const MAX_SAVED_CHUNKS = 9216;
38 $result->blockPosition = $blockPosition;
39 $result->radius = $radius;
40 $result->savedChunks = $savedChunks;
45 $this->blockPosition = $in->getSignedBlockPosition();
49 if($count > self::MAX_SAVED_CHUNKS){
50 throw new PacketDecodeException(
"Expected at most " . self::MAX_SAVED_CHUNKS .
" saved chunks, got " . $count);
52 for($i = 0, $this->savedChunks = []; $i < $count; $i++){
53 $this->savedChunks[] = ChunkPosition::read($in);
58 $out->putSignedBlockPosition($this->blockPosition);
61 $out->putLInt(count($this->savedChunks));
62 foreach($this->savedChunks as $chunk){
68 return $handler->handleNetworkChunkPublisherUpdate($this);
decodePayload(PacketSerializer $in)
handle(PacketHandlerInterface $handler)
static create(BlockPosition $blockPosition, int $radius, array $savedChunks)
encodePayload(PacketSerializer $out)
putUnsignedVarInt(int $v)