Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- double amount = 0.6;
- if (Minecraft.isFancyGraphicsEnabled() && Calendar.getInstance().getTime().getTime() % 1L == 0L) {
- boolean shouldMove = true;
- boolean movingUp = false;
- if (previousRotationY < (double)myPlayer.rotationPitch) {
- previousRotationY = myPlayer.rotationPitch;
- rotationY += amount / 2.0;
- shouldMove = false;
- movingUp = true;
- } else if (previousRotationY > (double)myPlayer.rotationPitch) {
- previousRotationY = myPlayer.rotationPitch;
- rotationY -= amount / 2.0;
- shouldMove = false;
- movingUp = true;
- }
- if (previousRotationX < (double)myPlayer.rotationYaw) {
- previousRotationX = myPlayer.rotationYaw;
- rotationX += movingUp ? amount / 4.0 : amount;
- shouldMove = false;
- } else if (previousRotationX > (double)myPlayer.rotationYaw) {
- previousRotationX = myPlayer.rotationYaw;
- rotationX -= movingUp ? amount / 4.0 : amount;
- shouldMove = false;
- }
- //if (previousRotationZ < (double)myPlayer.rotationYaw) {
- // previousRotationZ = myPlayer.rotationYaw;
- // rotationX += movingUp ? amount / 4.0 : amount;
- // shouldMove = false;
- //} else if (previousRotationZ > (double)myPlayer.rotationYaw) {
- // previousRotationZ = myPlayer.rotationYaw;
- // rotationZ -= movingUp ? amount / 4.0 : amount;
- // shouldMove = false;
- //}
- if (shouldMove) {
- if (rotationX < 0.0) {
- rotationX += 0.01;
- } else if (rotationX > 0.0) {
- rotationX -= 0.01;
- }
- if (rotationY < 0.0) {
- rotationY += 0.01;
- } else if (rotationY > 0.0) {
- rotationY -= 0.01;
- }
- //if (rotationZ < 0.0) {
- // rotationZ += 0.01;
- //} else if (rotationZ > 0.0) {
- // rotationZ -= 0.01;
- //}
- }
- if (rotationX < -5.0) {
- rotationX = -5.0;
- } else if (rotationX > 5.0) {
- rotationX = 5.0;
- }
- if (rotationY < 0.0) {
- rotationY = 0.0;
- } else if (rotationY > 3.0) {
- rotationY = 3.0;
- }
- //if (rotationZ < 0.0) {
- // rotationZ = 0.0;
- //} else if (rotationZ > 3.0) {
- // rotationZ = 3.0;
- //}
- //TODO: проверка на прицеливание
- if (ItemGun.getSighted() == 0) {
- GL11.glRotated((double) rotationY, (double) 0.0, (double) 0.0, (double) 1.0);
- GL11.glRotated((double) rotationX, (double) 0.0, (double) 1.0, (double) 0.0);
- //GL11.glRotated((double) rotationZ, (double) 1.0, (double) 0.0, (double) 0.0);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement