diff --git a/src/PacketPool.php b/src/PacketPool.php index 0ec6e6cd..fb4633d5 100644 --- a/src/PacketPool.php +++ b/src/PacketPool.php @@ -237,6 +237,8 @@ public function __construct(){ $this->registerPacket(new ServerboundDiagnosticsPacket()); $this->registerPacket(new CameraAimAssistPacket()); $this->registerPacket(new ContainerRegistryCleanupPacket()); + $this->registerPacket(new MovementEffectPacket()); + $this->registerPacket(new SetMovementAuthorityPacket()); } public function registerPacket(Packet $packet) : void{ diff --git a/src/types/PlayerMovementSettings.php b/src/types/PlayerMovementSettings.php index f1948418..e073b6fc 100644 --- a/src/types/PlayerMovementSettings.php +++ b/src/types/PlayerMovementSettings.php @@ -18,26 +18,26 @@ final class PlayerMovementSettings{ public function __construct( - private int $movementType, + private ServerAuthMovementMode $movementType, private int $rewindHistorySize, private bool $serverAuthoritativeBlockBreaking ){} - public function getMovementType() : int{ return $this->movementType; } + public function getMovementType() : ServerAuthMovementMode{ return $this->movementType; } public function getRewindHistorySize() : int{ return $this->rewindHistorySize; } public function isServerAuthoritativeBlockBreaking() : bool{ return $this->serverAuthoritativeBlockBreaking; } public static function read(PacketSerializer $in) : self{ - $movementType = $in->getVarInt(); + $movementType = ServerAuthMovementMode::fromPacket($in->getVarInt()); $rewindHistorySize = $in->getVarInt(); $serverAuthBlockBreaking = $in->getBool(); return new self($movementType, $rewindHistorySize, $serverAuthBlockBreaking); } public function write(PacketSerializer $out) : void{ - $out->putVarInt($this->movementType); + $out->putVarInt($this->movementType->value); $out->putVarInt($this->rewindHistorySize); $out->putBool($this->serverAuthoritativeBlockBreaking); } diff --git a/src/types/PlayerMovementType.php b/src/types/PlayerMovementType.php deleted file mode 100644 index 0c527822..00000000 --- a/src/types/PlayerMovementType.php +++ /dev/null @@ -1,22 +0,0 @@ - - * - * BedrockProtocol is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - */ - -declare(strict_types=1); - -namespace pocketmine\network\mcpe\protocol\types; - -final class PlayerMovementType{ - - public const LEGACY = 0; //MovePlayerPacket - public const SERVER_AUTHORITATIVE_V1 = 1; //PlayerAuthInputPacket - public const SERVER_AUTHORITATIVE_V2_REWIND = 2; //PlayerAuthInputPacket + movement replay (used for server authoritative knockback) -}