Allow friction based horizontal distance in creativefly.

This commit is contained in:
asofold 2016-01-19 00:20:00 +01:00
parent 57378a1f11
commit 822cb90410

View File

@ -96,7 +96,14 @@ public class CreativeFly extends Check {
fSpeed *= data.walkSpeed / 0.2;
}
final double limitH = model.hMod / 100D * ModelFlying.HORIZONTAL_SPEED * fSpeed;
double limitH = model.hMod / 100D * ModelFlying.HORIZONTAL_SPEED * fSpeed;
if (lastMove.toIsValid) {
// TODO: Use last friction (as well)?
// TODO: Test/adjust more.
double frictionDist = lastMove.hDistance * Magic.FRICTION_MEDIUM_AIR;
limitH = Math.max(frictionDist, limitH);
}
// Finally, determine how far the player went beyond the set limits.
// double resultH = Math.max(0.0D, hDistance - data.horizontalFreedom - limitH);
@ -142,6 +149,7 @@ public class CreativeFly extends Check {
if (lastMove.toIsValid) {
// (Disregard gravity.)
// TODO: Use last friction (as well)?
double frictionDist = lastMove.yDistance * Magic.FRICTION_MEDIUM_AIR;
if (!flying) {
frictionDist -= Magic.GRAVITY_MIN;