20 public const NETWORK_ID = ProtocolInfo::CAMERA_SHAKE_PACKET;
22 public const TYPE_POSITIONAL = 0;
23 public const TYPE_ROTATIONAL = 1;
25 public const ACTION_ADD = 0;
26 public const ACTION_STOP = 1;
28 private float $intensity;
29 private float $duration;
30 private int $shakeType;
31 private int $shakeAction;
36 public static function create(
float $intensity,
float $duration,
int $shakeType,
int $shakeAction) : self{
38 $result->intensity = $intensity;
39 $result->duration = $duration;
40 $result->shakeType = $shakeType;
41 $result->shakeAction = $shakeAction;
45 public function getIntensity() : float{ return $this->intensity; }
47 public function getDuration() : float{ return $this->duration; }
49 public function getShakeType() : int{ return $this->shakeType; }
51 public function getShakeAction() : int{ return $this->shakeAction; }
54 $this->intensity = $in->getLFloat();
56 $this->shakeType = $in->
getByte();
57 $this->shakeAction = $in->
getByte();
61 $out->putLFloat($this->intensity);
62 $out->putLFloat($this->duration);
63 $out->putByte($this->shakeType);
64 $out->putByte($this->shakeAction);
68 return $handler->handleCameraShake($this);