Advertisement
Guest User

Untitled

a guest
Feb 7th, 2016
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.44 KB | None | 0 0
  1.  
  2.  
  3.  
  4. @Override
  5. public void onUpdate() {
  6. if (!this.getState()) {
  7. return;
  8. }
  9. if(Wrapper.mc.thePlayer.onGround){
  10.  
  11. Wrapper.mc.thePlayer.setVelocity(Wrapper.mc.thePlayer.motionX, Wrapper.mc.thePlayer.motionY, Wrapper.mc.thePlayer.motionZ);
  12. double currentSpeed = Math.sqrt(Math.pow(Wrapper.mc.thePlayer.motionX, 2.0) + Math.pow(Wrapper.mc.thePlayer.motionZ, 2.0));
  13. double maxSpeed = 0.6899999976158142;
  14. if (currentSpeed > + maxSpeed) {
  15. Wrapper.mc.thePlayer.motionX = Wrapper.mc.thePlayer.motionX / currentSpeed * maxSpeed ;
  16. Wrapper.mc.thePlayer.motionZ = Wrapper.mc.thePlayer.motionZ / currentSpeed * maxSpeed ;
  17.  
  18. }
  19. }
  20. Wrapper.mc.thePlayer.jumpMovementFactor = (float)((double)Wrapper.mc.thePlayer.jumpMovementFactor * 1.45);
  21. if(Wrapper.mc.thePlayer.moveForward > 0){
  22. Wrapper.mc.thePlayer.setSprinting(true);
  23.  
  24.  
  25. if(Wrapper.mc.thePlayer.onGround){
  26. Wrapper.mc.thePlayer.jump();
  27.  
  28. packets = Wrapper.mc.thePlayer.posY;
  29. }
  30. if(!Wrapper.mc.thePlayer.onGround && packets + 0.399994 <= Wrapper.mc.thePlayer.posY ){
  31. Wrapper.mc.thePlayer.motionY = -0.93;
  32.  
  33. }
  34. }else{
  35. Wrapper.mc.thePlayer.setSprinting(false);
  36. }
  37.  
  38.  
  39.  
  40. }
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement