diff options
author | Detrav <witalyezep@gmail.com> | 2016-04-18 14:10:49 +0300 |
---|---|---|
committer | Detrav <witalyezep@gmail.com> | 2016-04-18 14:10:49 +0300 |
commit | d2bc4828e65ba5bdcf69ae08fe2cbc375460ee97 (patch) | |
tree | c9d62a62661ddadb40597c383bafd1dc9ce39524 /src/main/java/com | |
parent | 3e53fcce73d78f94550a8f79f8932ba0df3bf531 (diff) | |
download | GT5-Unofficial-d2bc4828e65ba5bdcf69ae08fe2cbc375460ee97.tar.gz GT5-Unofficial-d2bc4828e65ba5bdcf69ae08fe2cbc375460ee97.tar.bz2 GT5-Unofficial-d2bc4828e65ba5bdcf69ae08fe2cbc375460ee97.zip |
Fix rotation yaw
Diffstat (limited to 'src/main/java/com')
-rw-r--r-- | src/main/java/com/detrav/events/DetravBlockBreakEventHandler.java | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/main/java/com/detrav/events/DetravBlockBreakEventHandler.java b/src/main/java/com/detrav/events/DetravBlockBreakEventHandler.java index eea7c759e7..c903b50b20 100644 --- a/src/main/java/com/detrav/events/DetravBlockBreakEventHandler.java +++ b/src/main/java/com/detrav/events/DetravBlockBreakEventHandler.java @@ -52,9 +52,12 @@ public class DetravBlockBreakEventHandler { side = 0; break; case 3: - if ((-135 <= ev.getPlayer().rotationYaw && ev.getPlayer().rotationYaw <= -45) || (-315 <= ev.getPlayer().rotationYaw && ev.getPlayer().rotationYaw <= -225)) + float rotationYaw = ev.getPlayer().rotationYaw; + while (rotationYaw > 0) rotationYaw -= 360F; + while (rotationYaw < -360) rotationYaw += 360F; + if ((-135 <= rotationYaw && rotationYaw <= -45) || (-315 <= rotationYaw && rotationYaw <= -225)) side = 4; - else if ((-225 <= ev.getPlayer().rotationYaw && ev.getPlayer().rotationYaw <= -135) || -45 <= ev.getPlayer().rotationYaw || ev.getPlayer().rotationYaw <= -315) + else if ((-225 <= rotationYaw && rotationYaw <= -135) || -45 <= rotationYaw || rotationYaw <= -315) side = 2; else side = -1; break; |