13declare(strict_types=1);
15namespace pocketmine\network\mcpe\protocol;
23 public const NETWORK_ID = ProtocolInfo::UPDATE_SUB_CHUNK_BLOCKS_PACKET;
28 private array $layer0Updates;
30 private array $layer1Updates;
37 public static function create(
BlockPosition $baseBlockPosition, array $layer0Updates, array $layer1Updates) : self{
39 $result->baseBlockPosition = $baseBlockPosition;
40 $result->layer0Updates = $layer0Updates;
41 $result->layer1Updates = $layer1Updates;
45 public function getBaseBlockPosition() :
BlockPosition{ return $this->baseBlockPosition; }
54 $this->baseBlockPosition = $in->getBlockPosition();
55 $this->layer0Updates = [];
57 $this->layer0Updates[] = UpdateSubChunkBlocksPacketEntry::read($in);
59 $this->layer1Updates = [];
61 $this->layer1Updates[] = UpdateSubChunkBlocksPacketEntry::read($in);
66 $out->putBlockPosition($this->baseBlockPosition);
68 foreach($this->layer0Updates as $update){
72 foreach($this->layer1Updates as $update){
78 return $handler->handleUpdateSubChunkBlocks($this);
decodePayload(PacketSerializer $in)
encodePayload(PacketSerializer $out)
static create(BlockPosition $baseBlockPosition, array $layer0Updates, array $layer1Updates)
handle(PacketHandlerInterface $handler)
putUnsignedVarInt(int $v)