22 public const NETWORK_ID = ProtocolInfo::CORRECT_PLAYER_MOVE_PREDICTION_PACKET;
24 public const PREDICTION_TYPE_PLAYER = 0;
25 public const PREDICTION_TYPE_VEHICLE = 1;
29 private bool $onGround;
31 private int $predictionType;
32 private Vector2 $vehicleRotation;
33 private float $vehicleAngularVelocity;
45 float $vehicleAngularVelocity,
48 $result->position = $position;
49 $result->delta = $delta;
50 $result->onGround = $onGround;
51 $result->tick = $tick;
52 $result->predictionType = $predictionType;
53 $result->vehicleRotation = $vehicleRotation;
54 $result->vehicleAngularVelocity = $vehicleAngularVelocity;
58 public function getPosition() :
Vector3{ return $this->position; }
60 public function getDelta() :
Vector3{ return $this->delta; }
62 public function isOnGround() : bool{ return $this->onGround; }
64 public function getTick() : int{ return $this->tick; }
66 public function getPredictionType() : int{ return $this->predictionType; }
68 public function getVehicleRotation() : Vector2{ return $this->vehicleRotation; }
70 public function getVehicleAngularVelocity() : float{ return $this->vehicleAngularVelocity; }
73 $this->predictionType = $in->getByte();
77 $this->vehicleAngularVelocity = $in->
getFloat();
78 $this->onGround = $in->
getBool();
83 $out->putByte($this->predictionType);
86 $out->putFloat($this->vehicleRotation->getX());
87 $out->putFloat($this->vehicleRotation->getY());
88 $out->putFloat($this->vehicleAngularVelocity);
89 $out->putBool($this->onGround);
94 return $handler->handleCorrectPlayerMovePrediction($this);