Fixed Horse Jump height#411
Fixed Horse Jump height#411Micalobia wants to merge 1 commit intomaruohon:pre-rewrite/fabric/1.20.xfrom
Conversation
Re-derived the formula because it changed at some point; Horses can jump higher than they used to be able to. The original equation didn't need to be cubic either, so it's parabolic now.
|
Thanks. Can you clarify which MC version you tested this version in, and/or which MC version range is it valid for? If this is for the latest 1.21+ versions, then you should send this PR to Skaura-Ryoko's fork, as she maintains the mods in 1.20.5+. I can merge this for the older MC versions if I know which versions this is correct for. |
|
There was a different "fix" that someone discussed so I challenged them to provide the "proof" using Java Docs, etc. --> Note, that the code differs in location due to the info line abstraction project; but the concept is the same. |
|
Ah, yeah, I had tested on 1.21.8. I'll make a PR over there as well. I'm not sure how far back this is correct for, I haven't had the time to run the script on older versions. |
Re-derived the formula because it changed at some point; Horses can jump higher than they used to be able to. The original equation didn't need to be cubic either, so it's parabolic now.
To get my data, I used a Scarpet script to sweep the entire strength range from 0.4 to 1.0 in increments of 0.0001. Once I had that data, I used a Python script to perform the regression, and after testing a few equations I found that parabolic matched nearly perfect, which makes sense for gravity.
Here is my gist with both the Scarpet and Python scripts, as well as the generated data.
For history's sake, my original derivation (with data included) is here, which is different to the formula you pulled from the wiki at the time. It was on the wiki at some point (or at least one of my formulas was, I've done this a few times manually). As of right now there isn't a formula on the wiki at all.
This data also shows that the max and min height on Java Edition reflect the Bedrock values, instead of being slightly lower as the wiki suggests.
While I was there, I threw in a fix for the horse speed too. This resolves #406. I was the original contributor for the horse info lines in #112, figured I can come back and make sure everything is working.