Skip to content
This repository has been archived by the owner on Jan 8, 2019. It is now read-only.

Commit

Permalink
fix horse jump height, thanks Xericore. close #11
Browse files Browse the repository at this point in the history
  • Loading branch information
cyilin committed Mar 18, 2017
1 parent 34777eb commit 74fe387
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions src/main/java/com/zyin/zyinhud/mods/AnimalInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -549,14 +549,9 @@ private static String GetHorseMarkingText(AbstractHorse horse) {
* @return e.x. 1.2?-5.5?
*/
private static double GetHorseMaxJump(AbstractHorse horse) {
//simulate gravity and air resistance to determine the jump height
double yVelocity = horse.getHorseJumpStrength(); //horses's jump strength attribute
double jumpHeight = 0;
while (yVelocity > 0) {
jumpHeight += yVelocity;
yVelocity -= 0.08;
yVelocity *= 0.98;
}
double jumpPower = 1.0D; //see AbstractHorse.setJumpPower()
double maxJumpStrength = horse.getHorseJumpStrength() * jumpPower;
double jumpHeight = (-0.1817584952 * Math.pow(maxJumpStrength, 3)) + (3.689713992 * Math.pow(maxJumpStrength, 2)) + (2.128599134 * maxJumpStrength) - 0.343930367;
return jumpHeight;
}

Expand Down

0 comments on commit 74fe387

Please sign in to comment.