13declare(strict_types=1);
15namespace pocketmine\network\mcpe\protocol;
23 public const NETWORK_ID = ProtocolInfo::CAMERA_INSTRUCTION_PACKET;
29 private ?
bool $removeTarget;
37 $result->clear = $clear;
38 $result->fade = $fade;
39 $result->target = $target;
40 $result->removeTarget = $removeTarget;
46 public function getClear() : ?bool{ return $this->clear; }
48 public function getFade() : ?CameraFadeInstruction{ return $this->fade; }
50 public function getTarget() : ?CameraTargetInstruction{ return $this->target; }
55 $this->fade = $in->
readOptional(fn() => CameraFadeInstruction::read($in));
56 $this->target = $in->
readOptional(fn() => CameraTargetInstruction::read($in));
69 return $handler->handleCameraInstruction($this);
decodePayload(PacketSerializer $in)
encodePayload(PacketSerializer $out)
static create(?CameraSetInstruction $set, ?bool $clear, ?CameraFadeInstruction $fade, ?CameraTargetInstruction $target, ?bool $removeTarget)
handle(PacketHandlerInterface $handler)
writeOptional(mixed $value, \Closure $writer)
readOptional(\Closure $reader)