Perfect elytra simulation

This commit is contained in:
Brady 2023-06-21 18:59:44 -05:00
parent 877fd25608
commit 0aff31b768
No known key found for this signature in database
GPG Key ID: 73A788379A197567
1 changed files with 4 additions and 4 deletions

View File

@ -713,7 +713,7 @@ public final class ElytraBehavior extends Behavior implements IElytraBehavior, H
Vec3d stepped = motion;
Vec3d totalMotion = Vec3d.ZERO;
for (int i = 0; i < steps; i++) {
stepped = step(stepped, pitch, good.getYaw(), firework);
stepped = step(stepped, pitch, good.getYaw(), firework && i > 0);
Vec3d actualPositionPrevTick = ctx.playerFeetAsVec().add(totalMotion);
totalMotion = totalMotion.add(stepped);
Vec3d actualPosition = ctx.playerFeetAsVec().add(totalMotion);
@ -781,9 +781,9 @@ public final class ElytraBehavior extends Behavior implements IElytraBehavior, H
motionX += (lookDirection.x / pitchBase2 * flatMotion - motionX) * 0.1;
motionZ += (lookDirection.z / pitchBase2 * flatMotion - motionZ) * 0.1;
}
motionX *= 0.99;
motionY *= 0.98;
motionZ *= 0.99;
motionX *= 0.99f;
motionY *= 0.98f;
motionZ *= 0.99f;
//System.out.println(motionX + " " + motionY + " " + motionZ);
return new Vec3d(motionX, motionY, motionZ);