Advertisement
SirBaconBitz

Untitled

Apr 20th, 2015
278
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. public static void speedupPlayer(World world, Entity entity, double concreteVelocity)
  2. {
  3. double velocity = Math.sqrt(entity.field_70159_w * entity.field_70159_w + entity.field_70179_y * entity.field_70179_y);
  4. if (!(entity instanceof EntityPlayerSP)) {
  5. return;
  6. }
  7. if (velocity == 0.0D) {
  8. return;
  9. }
  10. if (velocity >= Configurations.concreteVelocity) {
  11. return;
  12. }
  13. EntityPlayerSP player = (EntityPlayerSP)entity;
  14. if ((Math.abs(player.field_71158_b.field_78900_b) < 0.75F) && (Math.abs(player.field_71158_b.field_78902_a) < 0.75F)) {
  15. return;
  16. }
  17. entity.field_70159_w = (Configurations.concreteVelocity * entity.field_70159_w / velocity);
  18. entity.field_70179_y = (Configurations.concreteVelocity * entity.field_70179_y / velocity);
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement