make freecam not interfere with Efly
All checks were successful
/ Build BaseBand DSM & Broadway (push) Successful in 2m10s

This commit is contained in:
Daniella / Tove 2024-06-12 21:48:39 +02:00
parent 7c4aa7d33c
commit 3e94eca157
Signed by: TudbuT
GPG key ID: B3CF345217F202D3

View file

@ -234,34 +234,36 @@ public class ElytraFly extends Feature {
return; return;
if (mc.player.isElytraFlying()) { if (mc.player.isElytraFlying()) {
if(!blockMovement) { if(!blockMovement) {
double motionY = 0; if(mc.getRenderViewEntity() == mc.player) {
double[] motionXZ = MotionUtil.getMotion((double) hSpeed / 10); double motionY = 0;
double[] motionXZ = MotionUtil.getMotion((double) hSpeed / 10);
if (mc.player.ticksExisted % 10 == 0 && antiKick) { if (mc.player.ticksExisted % 10 == 0 && antiKick) {
motionY = -.04; motionY = -.04;
} else { } else {
if (mc.gameSettings.keyBindJump.isKeyDown()) { if (mc.gameSettings.keyBindJump.isKeyDown()) {
motionY = (double) vSpeed / 10; motionY = (double) vSpeed / 10;
} else if (mc.gameSettings.keyBindSneak.isKeyDown()) { } else if (mc.gameSettings.keyBindSneak.isKeyDown()) {
motionY = -(double) vSpeed / 10; motionY = -(double) vSpeed / 10;
}
if (mc.player.ticksExisted % 10 == 5 && antiKick) {
motionY += .04;
}
} }
if (mc.player.ticksExisted % 10 == 5 && antiKick) {
motionY += .04; e.x = motionXZ[0];
e.y = motionY;
e.z = motionXZ[1];
if (sounds) {
mc.player.setVelocity(motionXZ[0], motionY, motionXZ[1]);
} else {
mc.player.setVelocity(0, 0, 0);
} }
}
e.x = motionXZ[0];
e.y = motionY;
e.z = motionXZ[1];
if (sounds) {
mc.player.setVelocity(motionXZ[0], motionY, motionXZ[1]);
} else { } else {
mc.player.setVelocity(0, 0, 0); e.x = e.y = e.z = 0;
} }
//Prevent annoying bow behaviour and/or falling sounds when looking down
} else { } else {
e.x = motionX; e.x = motionX;
e.y = motionY; e.y = motionY;