Advertisement
Guest User

Untitled

a guest
Jul 16th, 2019
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 3.17 KB | None | 0 0
  1. double amount = 0.6;
  2.  
  3.         if (Minecraft.isFancyGraphicsEnabled() && Calendar.getInstance().getTime().getTime() % 1L == 0L) {
  4.             boolean shouldMove = true;
  5.             boolean movingUp = false;
  6.             if (previousRotationY < (double)myPlayer.rotationPitch) {
  7.                 previousRotationY = myPlayer.rotationPitch;
  8.                 rotationY += amount / 2.0;
  9.                 shouldMove = false;
  10.                 movingUp = true;
  11.             } else if (previousRotationY > (double)myPlayer.rotationPitch) {
  12.                 previousRotationY = myPlayer.rotationPitch;
  13.                 rotationY -= amount / 2.0;
  14.                 shouldMove = false;
  15.                 movingUp = true;
  16.             }
  17.             if (previousRotationX < (double)myPlayer.rotationYaw) {
  18.                 previousRotationX = myPlayer.rotationYaw;
  19.                 rotationX += movingUp ? amount / 4.0 : amount;
  20.                 shouldMove = false;
  21.             } else if (previousRotationX > (double)myPlayer.rotationYaw) {
  22.                 previousRotationX = myPlayer.rotationYaw;
  23.                 rotationX -= movingUp ? amount / 4.0 : amount;
  24.                 shouldMove = false;
  25.             }
  26.             //if (previousRotationZ < (double)myPlayer.rotationYaw) {
  27.             //    previousRotationZ = myPlayer.rotationYaw;
  28.             //    rotationX += movingUp ? amount / 4.0 : amount;
  29.             //    shouldMove = false;
  30.             //} else if (previousRotationZ > (double)myPlayer.rotationYaw) {
  31.             //    previousRotationZ = myPlayer.rotationYaw;
  32.             //    rotationZ -= movingUp ? amount / 4.0 : amount;
  33.             //    shouldMove = false;
  34.             //}
  35.             if (shouldMove) {
  36.                 if (rotationX < 0.0) {
  37.                     rotationX += 0.01;
  38.                 } else if (rotationX > 0.0) {
  39.                     rotationX -= 0.01;
  40.                 }
  41.                 if (rotationY < 0.0) {
  42.                     rotationY += 0.01;
  43.                 } else if (rotationY > 0.0) {
  44.                     rotationY -= 0.01;
  45.                 }
  46.                 //if (rotationZ < 0.0) {
  47.                 //    rotationZ += 0.01;
  48.                 //} else if (rotationZ > 0.0) {
  49.                 //    rotationZ -= 0.01;
  50.                 //}
  51.             }
  52.             if (rotationX < -5.0) {
  53.                 rotationX = -5.0;
  54.             } else if (rotationX > 5.0) {
  55.                 rotationX = 5.0;
  56.             }
  57.             if (rotationY < 0.0) {
  58.                 rotationY = 0.0;
  59.             } else if (rotationY > 3.0) {
  60.                 rotationY = 3.0;
  61.             }
  62.             //if (rotationZ < 0.0) {
  63.             //    rotationZ = 0.0;
  64.             //} else if (rotationZ > 3.0) {
  65.             //    rotationZ = 3.0;
  66.             //}
  67.             //TODO: проверка на прицеливание
  68.             if (ItemGun.getSighted() == 0) {
  69.                 GL11.glRotated((double) rotationY, (double) 0.0, (double) 0.0, (double) 1.0);
  70.                 GL11.glRotated((double) rotationX, (double) 0.0, (double) 1.0, (double) 0.0);
  71.                 //GL11.glRotated((double) rotationZ, (double) 1.0, (double) 0.0, (double) 0.0);
  72.             }
  73.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement