Fixed NPCs bobbing in the air when flying.

This commit is contained in:
luisc committed 2021-12-08 15:34:41 -06:00
1 parent 29db4bfe33
commit d37e986006
2 files changed
+4 -1

No files matched your search

@@ -51,6 +51,9 @@ public class FlyingMoveHelper extends EntityMoveHelper{
verticalSpeed = speed * speedMult;
verticalSpeed += this.entity.ai.flySpeed/2.0D;
if(verticalSpeed > Math.abs(this.entity.posY - this.posY))
verticalSpeed = Math.abs(this.entity.posY - this.posY);
this.entity.motionY -= Math.signum(this.entity.posY - this.posY) * verticalSpeed;
}
@@ -36,7 +36,7 @@ public abstract class EntityNPCFlying extends EntityNPCInterface {
return;
}
if (!this.onGround && !this.getMoveHelper().isUpdating())
if (!this.onGround)
{
this.motionY *= this.ai.flyGravity;
this.velocityChanged = true;