Fix cannon angles
This commit is contained in:
parent
9215d0d3ff
commit
155d8bff1b
@ -524,7 +524,11 @@ public class Cannon implements Listener
|
||||
double standYaw = Math.toDegrees(armorStand.getHeadPose().getY()) % 360;
|
||||
double riderYaw = _rider.getLocation().getYaw() % 360;
|
||||
|
||||
// riderYaw = 350 and standYaw = 20
|
||||
// dif should be -30 and not 330
|
||||
double dif = riderYaw - standYaw;
|
||||
if (dif > 180) dif -= 360;
|
||||
if (dif < -180) dif += 360;
|
||||
|
||||
double yaw = standYaw + Math.min(dif / 20.f, 5f);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user