Round position fixed-point numbers down - #723
Conversation
|
Even though vanilla uses floor, wouldn't it still better to use the round? This makes it as close as possible to the "real" value. |
|
In the case in which that solution applies, the true "server position" broadcast to players (ignoring translation) uses round. While this is different from 1.8, I don't see why we would want to intentionally create a desync between what clients on differing protocols see. The server is the source of truth, not the translation. If there's a legitimate use case or a case where this solution causes a problem I would like to know so we can get the correct solution in place. Maybe a config option? But to be honest this seems like more of a server side solution. If you want to preserve floor, the server should broadcast floor, and using round in translation will preserve whatever the server broadcasts more accurately anyways. |
|
@Term4 That makes sense! Honestly I'm coming from a 1.8 background so I've somewhat been trying to make everything like 1.8, but yeah it should probably be the other way around. |
While #707 correctly points out that truncating the 1.8 fixed-point position numbers is wrong, the solution presented there is also wrong. In all the packet handlers that transformer is used, the result should be rounded down (towards negative infinity) instead.
See source for things like
PacketPlayOutEntityTeleportetc.