use pocketmine\network\mcpe\protocol\serializer\PacketSerializer; class CameraShakePacket extends DataPacket implements ClientboundPacket{ public const NETWORK_ID = ProtocolInfo::CAMERA_SHAKE_PACKET; public const TYPE_POSITIONAL = 0; public const TYPE_ROTATIONAL = 1; /** @var float */ private $intensity; /** @var float */ private $duration; /** @var int */ private $shakeType; public static function create(float $intensity, float $duration, int $shakeType) : self{ $result = new self; $result->intensity = $intensity; $result->duration = $duration; $result->shakeType = $shakeType; return $result; } public function getIntensity() : float{ return $this->intensity; } public function getDuration() : float{ return $this->duration; } public function getShakeType() : int{ return $this->shakeType; } protected function decodePayload(PacketSerializer $in) : void{ $this->intensity = $in->getLFloat(); $this->duration = $in->getLFloat(); $this->shakeType = $in->getByte(); } protected function encodePayload(PacketSerializer $out) : void{ $out->putLFloat($this->intensity); $out->putLFloat($this->duration); $out->putByte($this->shakeType); } public function handle(PacketHandlerInterface $handler) : bool{ return $handler->handleCameraShake($this); } }