31 private array $floorBlocks,
32 private array $ceilingBlocks,
33 private ?
int $seaBlock,
34 private ?
int $foundationBlock,
35 private ?
int $beachBlock,
48 public function getSeaBlock() : ?int{ return $this->seaBlock; }
50 public function getFoundationBlock() : ?int{ return $this->foundationBlock; }
52 public function getBeachBlock() : ?int{ return $this->beachBlock; }
54 public static function read(ByteBufferReader $in) : self{
56 for($i = 0, $count = VarInt::readUnsignedInt($in); $i < $count; ++$i){
57 $floorBlocks[] = LE::readUnsignedInt($in);
61 for($i = 0, $count = VarInt::readUnsignedInt($in); $i < $count; ++$i){
62 $ceilingBlocks[] = LE::readUnsignedInt($in);
65 $seaBlock = CommonTypes::readOptional($in, LE::readUnsignedInt(...));
66 $foundationBlock = CommonTypes::readOptional($in, LE::readUnsignedInt(...));
67 $beachBlock = CommonTypes::readOptional($in, LE::readUnsignedInt(...));
78 public function write(ByteBufferWriter $out) : void{
79 VarInt::writeUnsignedInt($out, count($this->floorBlocks));
80 foreach($this->floorBlocks as $block){
81 LE::writeUnsignedInt($out, $block);
84 VarInt::writeUnsignedInt($out, count($this->ceilingBlocks));
85 foreach($this->ceilingBlocks as $block){
86 LE::writeUnsignedInt($out, $block);
89 CommonTypes::writeOptional($out, $this->seaBlock, LE::writeUnsignedInt(...));
90 CommonTypes::writeOptional($out, $this->foundationBlock, LE::writeUnsignedInt(...));
91 CommonTypes::writeOptional($out, $this->beachBlock, LE::writeUnsignedInt(...));