A boat facing south-east (yaw between -90 and 0) always drifts sideways, about ±0.05 blocks per 1000 blocks. Changing the yaw by the smallest step only flips the drift from + to -, there is no yaw in between with zero drift. North-west, south-west and north-east each have a small range of yaw with zero drift, so the boat moves exactly diagonally.
AbstractBoat#controlBoat adds Mth.sin(-yRot) on X and Mth.cos(yRot) on Z. Mth.sin and Mth.cos get the table index with (long)(value * 10430.378...), which rounds toward zero. For NW, SW and NE the two values have opposite signs, so both land on matching table entries (e.g. both 40960 at yaw 135). For SE both values are positive, the X index comes from 8192.x and the Z index from 8191.x, so they're always one entry apart and |x| never equals |z|.
Yaw 315 or -405 would work, but the server wraps yaw to -180..180 and the client gets it as a byte in that range, so a placed or summoned boat always ends up at -45.
Expected result: A boat facing south-east can move in an exact diagonal line.
Observed result: It always drifts left or right.
Reproduce:
On an ocean, run /summon minecraft:oak_boat ~ ~ ~ {Rotation:[135f,0f]} and get in.
Note X and Z in F3, hold W for about 1000 blocks, compare the distance moved on each axis. They match.
Repeat with {Rotation:[-45f,0f]}. They don't match.
TLDR: 1/4 of the intercardinal directions can’t allow for boats to move exactly diagonally, thus breaking longer ice highways.
Comments 0
No comments.