feather-rs / feather

A Minecraft server implementation in Rust
Apache License 2.0
2.58k stars 143 forks source link

Fix update_entity_position and fix writing of Angles to client. #490

Closed Tracreed closed 2 years ago

Tracreed commented 2 years ago

Fix update_entity_position and fix writing of Angles to client.

Status

Description

update_entity_position to use both EntityPosition and EntityPositionAndRotation instead of EntityTeleport packet. Also only sends EntityPositionAndRotation if there was a rotation.

The Writable implementation for Angle was broken before and if you moved in either direction too far it would get stuck on 255. This also solves that. Credits to @Miro-Andrin for coming up with the math.

Related issues

Checklist

Note: if you locally don't get any errors, but GitHub Actions fails (especially at clippy) you might want to check your rust toolchain version. You can then feel free to fix these warnings/errors in your PR.