Snap height only if on ground

(Original commit 2dc6ab453f931ac2083a6d142e963beb0a101b94)
This commit is contained in:
RednedEpic 2020-02-25 19:36:36 -06:00
parent a0152db80c
commit 4c87a13e25

View file

@ -62,7 +62,8 @@ public class BedrockMovePlayerTranslator extends PacketTranslator<MovePlayerPack
return;
}
double javaY = Math.ceil((packet.getPosition().getY() - EntityType.PLAYER.getOffset()) * 2) / 2;
double javaY = packet.getPosition().getY() - EntityType.PLAYER.getOffset();
if (packet.isOnGround()) javaY = Math.ceil(javaY * 2) / 2;
ClientPlayerPositionRotationPacket playerPositionRotationPacket = new ClientPlayerPositionRotationPacket(
packet.isOnGround(), GenericMath.round(packet.getPosition().getX(), 4), javaY, GenericMath.round(packet.getPosition().getZ(), 4), packet.getRotation().getY(), packet.getRotation().getX()
);