@@ -30,8 +30,8 @@ class GraphicsOverrideParameterPacket extends DataPacket implements ClientboundP
3030
3131 /** @var ParameterKeyframeValue[] */
3232 private array $ values = [];
33- private float $ unknownFloat ;
34- private Vector3 $ unknownVector3 ;
33+ private ? float $ unknownFloat ;
34+ private ? Vector3 $ unknownVector3 ;
3535 private string $ biomeIdentifier ;
3636 private GraphicsOverrideParameterType $ parameterType ;
3737 private bool $ reset ;
@@ -40,7 +40,7 @@ class GraphicsOverrideParameterPacket extends DataPacket implements ClientboundP
4040 * @generate-create-func
4141 * @param ParameterKeyframeValue[] $values
4242 */
43- public static function create (array $ values , float $ unknownFloat , Vector3 $ unknownVector3 , string $ biomeIdentifier , GraphicsOverrideParameterType $ parameterType , bool $ reset ) : self {
43+ public static function create (array $ values , ? float $ unknownFloat , ? Vector3 $ unknownVector3 , string $ biomeIdentifier , GraphicsOverrideParameterType $ parameterType , bool $ reset ) : self {
4444 $ result = new self ;
4545 $ result ->values = $ values ;
4646 $ result ->unknownFloat = $ unknownFloat ;
@@ -56,9 +56,9 @@ public static function create(array $values, float $unknownFloat, Vector3 $unkno
5656 */
5757 public function getValues () : array { return $ this ->values ; }
5858
59- public function getUnknownFloat () : float { return $ this ->unknownFloat ; }
59+ public function getUnknownFloat () : ? float { return $ this ->unknownFloat ; }
6060
61- public function getUnknownVector3 () : Vector3 { return $ this ->unknownVector3 ; }
61+ public function getUnknownVector3 () : ? Vector3 { return $ this ->unknownVector3 ; }
6262
6363 public function getBiomeIdentifier () : string { return $ this ->biomeIdentifier ; }
6464
@@ -71,8 +71,8 @@ protected function decodePayload(ByteBufferReader $in) : void{
7171 for ($ i = 0 ; $ i < $ count ; ++$ i ){
7272 $ this ->values [] = ParameterKeyframeValue::read ($ in );
7373 }
74- $ this ->unknownFloat = LE :: readFloat ($ in );
75- $ this ->unknownVector3 = CommonTypes::getVector3 ($ in );
74+ $ this ->unknownFloat = CommonTypes:: readOptional ($ in, LE :: readFloat (...) );
75+ $ this ->unknownVector3 = CommonTypes::readOptional ($ in, CommonTypes:: getVector3 (...) );
7676 $ this ->biomeIdentifier = CommonTypes::getString ($ in );
7777 $ this ->parameterType = GraphicsOverrideParameterType::fromPacket (Byte::readUnsigned ($ in ));
7878 $ this ->reset = CommonTypes::getBool ($ in );
@@ -83,8 +83,8 @@ protected function encodePayload(ByteBufferWriter $out) : void{
8383 foreach ($ this ->values as $ value ){
8484 $ value ->write ($ out );
8585 }
86- LE :: writeFloat ($ out , $ this ->unknownFloat );
87- CommonTypes::putVector3 ($ out , $ this ->unknownVector3 );
86+ CommonTypes:: writeOptional ($ out , $ this ->unknownFloat , LE :: writeFloat (...) );
87+ CommonTypes::writeOptional ($ out , $ this ->unknownVector3 , CommonTypes:: putVector3 (...) );
8888 CommonTypes::putString ($ out , $ this ->biomeIdentifier );
8989 Byte::writeUnsigned ($ out , $ this ->parameterType ->value );
9090 CommonTypes::putBool ($ out , $ this ->reset );
0 commit comments