From 003c522877429d492983035591d7e6a61736bf64 Mon Sep 17 00:00:00 2001 From: Dries C Date: Wed, 23 Oct 2024 17:25:18 +0200 Subject: [PATCH 1/2] Add missing changes to PacketPool --- src/PacketPool.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/PacketPool.php b/src/PacketPool.php index ab095cc2..e9a4be85 100644 --- a/src/PacketPool.php +++ b/src/PacketPool.php @@ -235,6 +235,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{ From 9be131e91b8f139530c0c7eaefe82c3553719ef5 Mon Sep 17 00:00:00 2001 From: Dries C Date: Thu, 24 Oct 2024 15:23:02 +0200 Subject: [PATCH 2/2] Remove PlayerMovementType --- src/types/PlayerMovementSettings.php | 8 ++++---- src/types/PlayerMovementType.php | 22 ---------------------- 2 files changed, 4 insertions(+), 26 deletions(-) delete mode 100644 src/types/PlayerMovementType.php 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) -}