Allow Bedrock players to sleep on Fabric

Fixes #5001
This commit is contained in:
Camotoy 2024-08-29 21:09:36 -04:00
parent 1b17c6bd8e
commit 63e60bc93c
No known key found for this signature in database
GPG key ID: 7EEFB66FE798081F

View file

@ -58,6 +58,14 @@ public class BedrockMovePlayerTranslator extends PacketTranslator<MovePlayerPack
session.confirmTeleport(packet.getPosition().toDouble().sub(0, EntityDefinitions.PLAYER.offset(), 0)); session.confirmTeleport(packet.getPosition().toDouble().sub(0, EntityDefinitions.PLAYER.offset(), 0));
return; return;
} }
if (entity.getBedPosition() != null) {
// https://github.com/GeyserMC/Geyser/issues/5001
// Bedrock 1.20.22 started sending a MovePlayerPacket as soon as it got into a bed.
// This trips up Fabric.
return;
}
float yaw = packet.getRotation().getY(); float yaw = packet.getRotation().getY();
float pitch = packet.getRotation().getX(); float pitch = packet.getRotation().getX();
float headYaw = packet.getRotation().getY(); float headYaw = packet.getRotation().getY();