Closed James103 closed 4 years ago
I've talked with @mchorse about this, and he said that my second idea would be a perfect solution to this, with my third solution being a possible alternative.
The code for the second idea would be as follows:
if (target.motionY < 5)
{
target.motionY *= (1.1 - target.motionY / 50.0);
}
Which would replace: https://github.com/asanetargoss/Changeling/blob/3208f2074ad466e74598c077441746668a1aeba7/src/main/java/mchorse/vanilla_pack/morphs/IronGolemMorph.java#L29
As for my third idea, since a gravity of 0.10 meters per tick squared supposedly still allows jumping 1 meter despite a 25% increase over standard gravity (0.08 meters per tick squared), either the gravity should be increased by 0.02 (target.motionY -= 0.02;
) or the gravity multiplied by 1.25.
I'm still waiting for @asanetargoss on what would be the best possible solution to this.
As per https://github.com/mchorse/metamorph/issues/206 , this is fine, waiting on McHorse to decide if survival-related code contributions should target Changeling only (and machinima-related code Metamorph only); would hopefully make our git sorcery a bit simpler and changes would make their way to the other mod eventually.
A new version of Changeling has been released on GitHub with the fix:
https://github.com/asanetargoss/Changeling/releases
I decided to postpone important maintenance, because I want to get a build up before McHorse's 1.12-only version of McLib gets released, and the possible confusion which could result from that.
I have tested this, a terminal velocity of approximately 100 m/s is reached while morphed as an Iron Golem, compared to 78.4 m/s for others. Jump height is about 1.1 m. No crash/kick is made.
See mchorse/metamorph#206 (reposted here because of same root cause)
When you are morphed as an Iron Golem, some weird things happen in regards to gravity and motion:
If you start bouncing on a Slime Block from high enough (about 20 blocks), you will bounce exponentially higher with each subsequent bounce. This reaches a point where you will lag very severely at the end of each bounce (as in several seconds per frame) and eventually crash and/or kick.
To fall from 10,000 blocks only takes twice as long as to fall from 100 blocks for you, compared to 10x longer for others. To fall from 100 million blocks only takes four times as long as to fall from just 100 blocks, compared to 1000x longer for others. This does not make sense at all.
Both of those things are caused by the following code below, which, multiplies the motion instead of adding to it every tick. There are a few possible solutions to this:
https://github.com/asanetargoss/Changeling/blob/3208f2074ad466e74598c077441746668a1aeba7/src/main/java/mchorse/vanilla_pack/morphs/IronGolemMorph.java#L20-L29