diff --git a/src/CorrectPlayerMovePredictionPacket.php b/src/CorrectPlayerMovePredictionPacket.php index d64d924d..0a690846 100644 --- a/src/CorrectPlayerMovePredictionPacket.php +++ b/src/CorrectPlayerMovePredictionPacket.php @@ -29,12 +29,12 @@ class CorrectPlayerMovePredictionPacket extends DataPacket implements Clientboun private bool $onGround; private int $tick; private int $predictionType; - private ?Vector2 $rotation; + private ?Vector2 $vehicleRotation; /** * @generate-create-func */ - public static function create(Vector3 $position, Vector3 $delta, bool $onGround, int $tick, int $predictionType, ?Vector2 $rotation) : self{ + public static function create(Vector3 $position, Vector3 $delta, bool $onGround, int $tick, int $predictionType, ?Vector2 $vehicleRotation) : self{ $result = new self; $result->position = $position; $result->delta = $delta; @@ -42,8 +42,8 @@ public static function create(Vector3 $position, Vector3 $delta, bool $onGround, $result->tick = $tick; $result->predictionType = $predictionType; - if($predictionType === self::PREDICTION_TYPE_VEHICLE && $rotation == null) { - throw new \InvalidArgumentException("CorrectPlayerMovePredictionPackets with type VEHICLE require a rotation to be provided"); + if($predictionType === self::PREDICTION_TYPE_VEHICLE && $vehicleRotation == null) { + throw new \InvalidArgumentException("CorrectPlayerMovePredictionPackets with type VEHICLE require a vehicleRotation to be provided"); } return $result; @@ -59,14 +59,14 @@ public function getTick() : int{ return $this->tick; } public function getPredictionType() : int{ return $this->predictionType; } - public function getRotation() : ?Vector2{ return $this->rotation; } + public function getVehicleRotation() : ?Vector2{ return $this->vehicleRotation; } protected function decodePayload(PacketSerializer $in) : void{ $this->predictionType = $in->getByte(); $this->position = $in->getVector3(); $this->delta = $in->getVector3(); if($this->predictionType === self::PREDICTION_TYPE_VEHICLE) { - $this->rotation = new Vector2($in->getFloat(), $in->getFloat()); + $this->vehicleRotation = new Vector2($in->getFloat(), $in->getFloat()); } $this->onGround = $in->getBool(); $this->tick = $in->getUnsignedVarLong(); @@ -77,8 +77,8 @@ protected function encodePayload(PacketSerializer $out) : void{ $out->putVector3($this->position); $out->putVector3($this->delta); if($this->predictionType === self::PREDICTION_TYPE_VEHICLE) { - $out->putFloat($this->rotation->getX()); - $out->putFloat($this->rotation->getY()); + $out->putFloat($this->vehicleRotation->getX()); + $out->putFloat($this->vehicleRotation->getY()); } $out->putBool($this->onGround); $out->putUnsignedVarLong($this->tick);