Advertisement
Guest User

Untitled

a guest
Mar 26th, 2017
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.96 KB | None | 0 0
  1.  
  2. double lastGround = 0;
  3.  
  4. boolean fix = false;
  5. boolean jumpFix = false;
  6.  
  7. boolean firstMove = false;
  8.  
  9. double move = 0;
  10.  
  11. @Override
  12. public void onUpdate() {
  13.  
  14. if (!this.isEnabled()) {
  15. lastGround = mc.thePlayer.posY;
  16. fix = false;
  17. jumpFix = false;
  18. return;
  19. }
  20.  
  21.  
  22.  
  23. if (jumpFix) {
  24.  
  25. // mc.thePlayer.motionY /= 1.05;
  26.  
  27. if (move > 0.01) {
  28. move(mc.thePlayer.rotationYaw, (float) move);
  29. } else {
  30. jumpFix = false;
  31. }
  32.  
  33. return;
  34. }
  35.  
  36. if (fix) {
  37. fix = false;
  38. mc.thePlayer.motionY = 0.0;
  39. jumpFix = true;
  40.  
  41. move(mc.thePlayer.rotationYaw, (float) 3.6, 0.012f);
  42.  
  43. move = 0.28f;
  44.  
  45. return;
  46. }
  47.  
  48. if (lastGround <= mc.thePlayer.posY - 2.4) {
  49. mc.thePlayer.motionY = 0.00;
  50. fix = true;
  51. return;
  52. } else if (lastGround <= mc.thePlayer.posY - 1.5) {
  53. mc.thePlayer.setPosition(mc.thePlayer.posX, mc.thePlayer.posY + 0.95, mc.thePlayer.posZ);
  54. mc.thePlayer.motionX = 0;
  55. mc.thePlayer.motionZ = 0;
  56. return;
  57. }
  58.  
  59. if (mc.thePlayer.motionY > 0.0001) {
  60.  
  61. mc.thePlayer.motionY += 0.01496;
  62.  
  63. move(mc.thePlayer.rotationYaw, (float) 0.39f); // Changable
  64. firstMove = false;
  65. }
  66.  
  67. super.onUpdate();
  68. }
  69.  
  70. @Override
  71. public void onEnable() {
  72.  
  73. move(mc.thePlayer.rotationYaw, 0f, 0.42f);
  74.  
  75. super.onEnable();
  76. }
  77.  
  78. public void move(float yaw, float multiplyer, float up) {
  79. // double moveX = -Math.sin(Math.toRadians(yaw)) * 0.1644;
  80.  
  81. double moveX = -Math.sin(Math.toRadians(yaw)) * multiplyer;
  82. double moveZ = Math.cos(Math.toRadians(yaw)) * multiplyer;
  83. double moveY = up;
  84.  
  85. Wrapper.mc.thePlayer.motionX = moveX;
  86. Wrapper.mc.thePlayer.motionY = moveY;
  87. Wrapper.mc.thePlayer.motionZ = moveZ;
  88.  
  89. }
  90.  
  91. public void move(float yaw, float multiplyer) {
  92. double moveX = -Math.sin(Math.toRadians(yaw)) * multiplyer;
  93. double moveZ = Math.cos(Math.toRadians(yaw)) * multiplyer;
  94.  
  95. Wrapper.mc.thePlayer.motionX = moveX;
  96. Wrapper.mc.thePlayer.motionZ = moveZ;
  97.  
  98. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement