Skip to content

Commit 96dde17

Browse files
committed
Resolve CameraAimAssistPreset for older versions
1 parent bdc6109 commit 96dde17

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/PlayerAuthInputPacket.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,10 @@ public static function create(
143143
Vector3 $cameraOrientation,
144144
Vector2 $rawMove
145145
) : self{
146+
if($inputFlags->getLength() !== 65){
147+
throw new \InvalidArgumentException("Input flags must be 65 bits long");
148+
}
149+
146150
if($playMode === PlayMode::VR and $vrGazeDirection === null){
147151
//yuck, can we get a properly written packet just once? ...
148152
throw new \InvalidArgumentException("Gaze direction must be provided for VR play mode");

src/types/camera/CameraAimAssistPreset.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public function getDefaultHandSettings() : ?string{ return $this->defaultHandSet
6060

6161
public static function read(PacketSerializer $in) : self{
6262
$identifier = $in->getString();
63-
if($in->getProtocolId() >= ProtocolInfo::PROTOCOL_1_21_60){
63+
if($in->getProtocolId() < ProtocolInfo::PROTOCOL_1_21_60){
6464
$categories = $in->getString();
6565
}
6666

@@ -95,7 +95,7 @@ public static function read(PacketSerializer $in) : self{
9595

9696
public function write(PacketSerializer $out) : void{
9797
$out->putString($this->identifier);
98-
if($out->getProtocolId() >= ProtocolInfo::PROTOCOL_1_21_60){
98+
if($out->getProtocolId() < ProtocolInfo::PROTOCOL_1_21_60){
9999
$out->putString($this->categories);
100100
}
101101

0 commit comments

Comments
 (0)