Advertisement
GamingLVScripts

moveFlying

Apr 1st, 2024
314
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.87 KB | None | 0 0
  1.     @Override
  2.     public void moveFlying(float f, float f2, float f3) {
  3.         MoveFlyingEvent moveFlyingEvent = new MoveFlyingEvent(f, f2, f3).publishItself();
  4.         f = moveFlyingEvent.getStrafe();
  5.         f2 = moveFlyingEvent.getForward();
  6.         if (moveFlyingEvent.isCancelled()) {
  7.             return;
  8.         }
  9.         float f4 = PlayerHandler.moveFix ? PlayerHandler.yaw : this.rotationYaw;
  10.         float f5 = f * f + f2 * f2;
  11.         if (f5 >= 1.0E-4f) {
  12.             if ((f5 = MathHelper.sqrt_float(f5)) < 1.0f) {
  13.                 f5 = 1.0f;
  14.             }
  15.             f5 = f3 / f5;
  16.             float f6 = MathHelper.sin(f4 * (float)Math.PI / 180.0f);
  17.             float f7 = MathHelper.cos(f4 * (float)Math.PI / 180.0f);
  18.             this.motionX += (double)((f *= f5) * f7 - (f2 *= f5) * f6);
  19.             this.motionZ += (double)(f2 * f7 + f * f6);
  20.         }
  21.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement