mirror of
https://github.com/Minestom/Minestom.git
synced 2024-09-29 23:17:59 +02:00
Actually fix issue direction issue with yaw < 0
This commit is contained in:
parent
9e7f05c311
commit
1cb8166edd
@ -32,6 +32,7 @@ public class MathUtils {
|
||||
// +45f gives a 90° angle for the direction (-1° and 1° are towards the same direction)
|
||||
int directionIndex = (int) Math.floor(((yawInDegrees+45f) / 90f));
|
||||
if(directionIndex < 0) {
|
||||
directionIndex = (-directionIndex) % Direction.HORIZONTAL.length;
|
||||
directionIndex = Direction.HORIZONTAL.length-directionIndex;
|
||||
}
|
||||
directionIndex %= Direction.HORIZONTAL.length;
|
||||
|
Loading…
Reference in New Issue
Block a user