Fixed strange flight behavior in flying NPCs with sizes below 5.

This commit is contained in:
Luis C.M committed 2022-11-07 13:32:31 -06:00
1 parent a1eb8ff91b
commit 219d0f1802
2 files changed
+3 -3

No files matched your search

@@ -41,7 +41,7 @@ public abstract class EntityNPCFlying extends EntityNPCInterface {
}
double heightOffGround = this.posY - this.worldObj.getTopSolidOrLiquidBlock((int) this.posX, (int) this.posZ);
if (heightOffGround > this.ai.flyHeightLimit && this.ai.hasFlyLimit || (heightOffGround < this.height && this.motionY == 0)) {
if (heightOffGround > this.ai.flyHeightLimit && this.ai.hasFlyLimit || (heightOffGround < Math.ceil(this.height) && this.motionY == 0)) {
this.flyLimitAllow = false;
if (!this.getNavigator().noPath() && this.motionY > 0) {
this.motionY = 0;