Advertisement
Guest User

Untitled

a guest
Mar 26th, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.47 KB | None | 0 0
  1. package fixed.liquiddev.modules.Movement;
  2.  
  3. import org.lwjgl.input.Keyboard;
  4.  
  5. import fixed.liquiddev.modules.Category;
  6. import fixed.liquiddev.modules.MODULE;
  7. import fixed.liquiddev.ui.Wrapper;
  8. import net.minecraft.network.play.client.C03PacketPlayer;
  9.  
  10. public class Module_Fly extends MODULE {
  11.  
  12. public Module_Fly() {
  13. super("Fly", "fly", Keyboard.KEY_G, Category.MOVEMENT);
  14. }
  15.  
  16. String mode = "vanilla";
  17.  
  18. @Override
  19. public void onUpdate() {
  20.  
  21. if (!this.isEnabled()) {
  22. lastYaw = mc.thePlayer.rotationYaw;
  23. i = 0;
  24. return;
  25. }
  26.  
  27. if (mode.equalsIgnoreCase("vanilla"))
  28. Wrapper.mc.thePlayer.capabilities.isFlying = true;
  29. else if (mode.equalsIgnoreCase("aac")) {
  30. aac305();
  31. }
  32.  
  33. super.onUpdate();
  34. }
  35.  
  36. @Override
  37. public void onCommand(String[] args) {
  38.  
  39. if (args.length == 2) {
  40.  
  41. if (args[0].toString().equalsIgnoreCase("mode")) {
  42. this.mode = args[1].toString();
  43. Wrapper.addChat("§aMode ist now " + mode);
  44. return;
  45. } else if (args[0].toString().equalsIgnoreCase("glide")) {
  46. this.glideMove = Float.valueOf(args[1].toString());
  47. Wrapper.addChat("§aGlide ist now " + glide);
  48. return;
  49. }
  50.  
  51. return;
  52. }
  53.  
  54. Wrapper.addChat("§cWrong args: .fly <mode/glide> <[mode]/[glide]>");
  55. super.onCommand(args);
  56. }
  57.  
  58. @Override
  59. public void onDisable() {
  60. Wrapper.mc.thePlayer.capabilities.isFlying = false;
  61. super.onDisable();
  62. }
  63.  
  64. boolean isDoing = false;
  65. boolean glide = false;
  66.  
  67. int i = 0;;
  68.  
  69. float lastYaw = 0;
  70.  
  71. float glideMove = 0.7f;
  72.  
  73. @Override
  74. public void onEnable() {
  75.  
  76. if (mc.thePlayer != null && mc.thePlayer.worldObj != null && mc.thePlayer.worldObj.isRemote) {
  77. lastYaw = mc.thePlayer.rotationYaw;
  78. mc.thePlayer.jump();
  79.  
  80. glide = true;
  81. move(mc.thePlayer.rotationYaw, 0.02f);
  82. }
  83. super.onEnable();
  84. }
  85.  
  86. public void aac305() {
  87.  
  88. mc.thePlayer.setSprinting(true);
  89.  
  90. // Exploit to set lastFlag in air
  91. if (glide && mc.thePlayer.fallDistance > 0.02 && mc.thePlayer.fallDistance < 0.8) {
  92. move(mc.thePlayer.rotationYaw, glideMove);
  93. lastYaw = mc.thePlayer.rotationYaw;
  94. return;
  95. }
  96.  
  97. // End?
  98. if (mc.thePlayer.fallDistance < 0.6 || mc.thePlayer.motionY >= -0.1) {
  99. lastYaw = mc.thePlayer.rotationYaw;
  100. return;
  101. }
  102.  
  103. glide = false;
  104.  
  105. // do the Flag
  106. if (isDoing == false) {
  107. mc.thePlayer.motionY = -0.0;
  108. isDoing = true;
  109. lastYaw = mc.thePlayer.rotationYaw;
  110. return;
  111. }
  112.  
  113. // Motion up
  114. mc.thePlayer.motionY = 0.1;
  115.  
  116.  
  117. // Motion forward
  118. if (Math.abs(lastYaw - mc.thePlayer.rotationYaw) < 3) {
  119. if (i == 0) {
  120. move(mc.thePlayer.rotationYaw, 0.3f);
  121. } else {
  122. move(mc.thePlayer.rotationYaw, 0.18f);
  123. }
  124. } else {
  125. move(mc.thePlayer.rotationYaw, 0.08f);
  126. i = 1;
  127. }
  128.  
  129. // set last yaw
  130. lastYaw = mc.thePlayer.rotationYaw;
  131. super.onUpdate();
  132. }
  133.  
  134. public void move(float yaw, float multiplyer, float up) {
  135. // double moveX = -Math.sin(Math.toRadians(yaw)) * 0.1644;
  136.  
  137. double moveX = -Math.sin(Math.toRadians(yaw)) * multiplyer;
  138. double moveZ = Math.cos(Math.toRadians(yaw)) * multiplyer;
  139. double moveY = up;
  140.  
  141. Wrapper.mc.thePlayer.motionX = moveX;
  142. Wrapper.mc.thePlayer.motionY = moveY;
  143. Wrapper.mc.thePlayer.motionZ = moveZ;
  144.  
  145. }
  146.  
  147. public void move(float yaw, float multiplyer) {
  148. double moveX = -Math.sin(Math.toRadians(yaw)) * multiplyer;
  149. double moveZ = Math.cos(Math.toRadians(yaw)) * multiplyer;
  150.  
  151. Wrapper.mc.thePlayer.motionX = moveX;
  152. Wrapper.mc.thePlayer.motionZ = moveZ;
  153.  
  154. }
  155. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement