InGamePacketHandler: add a hack for swimming AABB client bug

This commit is contained in:
Dylan K. Taylor 2022-01-27 00:28:54 +00:00
parent 6cbc14f2b2
commit d9ea647925
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D

View File

@ -90,6 +90,8 @@ use pocketmine\network\mcpe\protocol\SubClientLoginPacket;
use pocketmine\network\mcpe\protocol\TextPacket;
use pocketmine\network\mcpe\protocol\types\ActorEvent;
use pocketmine\network\mcpe\protocol\types\BlockPosition;
use pocketmine\network\mcpe\protocol\types\entity\EntityMetadataProperties;
use pocketmine\network\mcpe\protocol\types\entity\FloatMetadataProperty;
use pocketmine\network\mcpe\protocol\types\inventory\ContainerIds;
use pocketmine\network\mcpe\protocol\types\inventory\MismatchTransactionData;
use pocketmine\network\mcpe\protocol\types\inventory\NetworkInventoryAction;
@ -222,6 +224,11 @@ class InGamePacketHandler extends PacketHandler{
($gliding !== null && !$this->player->toggleGlide($gliding));
if((bool) $mismatch){
$this->player->sendData([$this->player]);
}elseif($packet->hasFlag(PlayerAuthInputFlags::STOP_SWIMMING) || $packet->hasFlag(PlayerAuthInputFlags::STOP_GLIDING)){
//TODO: HACK! workaround for a client bug where the AABB doesn't change back properly when stopping swimming or gliding
$this->player->sendData([$this->player], [
EntityMetadataProperties::BOUNDING_BOX_HEIGHT => new FloatMetadataProperty($this->player->getSize()->getHeight())
]);
}
if($packet->hasFlag(PlayerAuthInputFlags::START_JUMPING)){