Advertisement
Guest User

Untitled

a guest
Jan 21st, 2018
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.95 KB | None | 0 0
  1. public final class Strafe
  2. extends ModBase
  3. {
  4. public Strafe()
  5. {
  6. super("Strafe", "0", true, ".t strafe", Category.Combat);
  7. setColor(9883085);
  8. setDescription("Skip much faster at the time of PvP");
  9. setEnabled(true);
  10. }
  11.  
  12. public void postUpdate()
  13. {
  14. if (Minecraft.thePlayer.onGround) {
  15. return;
  16. }
  17. if ((!Minecraft.thePlayer.onGround) && (!Minecraft.thePlayer.isInWater()))
  18. {
  19. float dir = Minecraft.thePlayer.rotationYaw;
  20. if (Minecraft.thePlayer.moveForward < 0.0F) {
  21. dir += 180.0F;
  22. }
  23. if (Minecraft.thePlayer.moveStrafing > 0.0F) {
  24. dir -= 90.0F * (Minecraft.thePlayer.moveForward < 0.0F ? -0.5F : Minecraft.thePlayer.moveForward > 0.0F ? 0.5F : 1.0F);
  25. }
  26. if (Minecraft.thePlayer.moveStrafing < 0.0F) {
  27. dir += 90.0F * (Minecraft.thePlayer.moveForward < 0.0F ? -0.5F : Minecraft.thePlayer.moveForward > 0.0F ? 0.5F : 1.0F);
  28. }
  29. double hOff = 0.221D;
  30. if (Minecraft.thePlayer.isSprinting()) {
  31. hOff *= 1.3190000119209289D;
  32. }
  33. if (Minecraft.thePlayer.isSneaking()) {
  34. hOff *= 0.3D;
  35. }
  36. if (Minecraft.thePlayer.getActivePotionEffect(Potion.moveSpeed) != null) {
  37. for (int xD = 0; xD < Minecraft.thePlayer.getActivePotionEffect(Potion.moveSpeed).getAmplifier() + 1; xD++) {
  38. hOff *= 1.2000000029802322D;
  39. }
  40. }
  41. float var9 = (float)((float)Math.cos((dir + 90.0F) * 3.141592653589793D / 180.0D) * hOff);
  42. float zD = (float)((float)Math.sin((dir + 90.0F) * 3.141592653589793D / 180.0D) * hOff);
  43. if ((Minecraft.getMinecraft().gameSettings.keyBindForward.pressed) || (Minecraft.getMinecraft().gameSettings.keyBindLeft.pressed) || (Minecraft.getMinecraft().gameSettings.keyBindRight.pressed) || (Minecraft.getMinecraft().gameSettings.keyBindBack.pressed))
  44. {
  45. Minecraft.thePlayer.motionX = var9;
  46. Minecraft.thePlayer.motionZ = zD;
  47. }
  48. }
  49. }
  50. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement