32 private array $nonReplaceableBlocks,
33 private array $gradientBlocks,
34 private string $noiseSeed,
35 private int $firstOctave,
36 private array $amplitudes
49 public function getNoiseSeed() : string{ return $this->noiseSeed; }
51 public function getFirstOctave() : int{ return $this->firstOctave; }
58 public static function read(ByteBufferReader $in) : self{
59 $nonReplaceableBlocks = [];
60 for($i = 0, $count = VarInt::readUnsignedInt($in); $i < $count; ++$i){
61 $nonReplaceableBlocks[] = LE::readUnsignedInt($in);
65 for($i = 0, $count = VarInt::readUnsignedInt($in); $i < $count; ++$i){
66 $gradientBlocks[] = LE::readUnsignedInt($in);
69 $noiseSeed = CommonTypes::getString($in);
70 $firstOctave = LE::readUnsignedInt($in);
73 for($i = 0, $count = VarInt::readUnsignedInt($in); $i < $count; ++$i){
74 $amplitudes[] = LE::readFloat($in);
78 $nonReplaceableBlocks,
86 public function write(ByteBufferWriter $out) : void{
87 VarInt::writeUnsignedInt($out, count($this->nonReplaceableBlocks));
88 foreach($this->nonReplaceableBlocks as $value){
89 LE::writeUnsignedInt($out, $value);
92 VarInt::writeUnsignedInt($out, count($this->gradientBlocks));
93 foreach($this->gradientBlocks as $value){
94 LE::writeUnsignedInt($out, $value);
97 CommonTypes::putString($out, $this->noiseSeed);
98 LE::writeUnsignedInt($out, $this->firstOctave);
100 VarInt::writeUnsignedInt($out, count($this->amplitudes));
101 foreach($this->amplitudes as $value){
102 LE::writeFloat($out, $value);