Skip to content

Commit

Permalink
Added property getters in packets (#265)
Browse files Browse the repository at this point in the history
A few packets (mostly new) don't have getters for certain private properties
  • Loading branch information
Superomarking authored Aug 17, 2024
1 parent e226413 commit cac5a16
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/CameraInstructionPacket.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ public function getFade() : ?CameraFadeInstruction{ return $this->fade; }

public function getTarget() : ?CameraTargetInstruction{ return $this->target; }

public function getRemoveTarget() : ?bool{ return $this->removeTarget; }

protected function decodePayload(PacketSerializer $in) : void{
$this->set = $in->readOptional(fn() => CameraSetInstruction::read($in));
$this->clear = $in->readOptional($in->getBool(...));
Expand Down
2 changes: 2 additions & 0 deletions src/ChangeDimensionPacket.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ public static function create(int $dimension, Vector3 $position, bool $respawn,
return $result;
}

public function getLoadingScreenId() : ?int{ return $this->loadingScreenId; }

protected function decodePayload(PacketSerializer $in) : void{
$this->dimension = $in->getVarInt();
$this->position = $in->getVector3();
Expand Down
4 changes: 4 additions & 0 deletions src/UpdateClientInputLocksPacket.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ public static function create(int $flags, Vector3 $position) : self{
return $result;
}

public function getFlags() : int{ return $this->flags; }

public function getPosition() : Vector3{ return $this->position; }

protected function decodePayload(PacketSerializer $in) : void{
$this->flags = $in->getUnsignedVarInt();
$this->position = $in->getVector3();
Expand Down

0 comments on commit cac5a16

Please sign in to comment.