Fixed flying limits not working on flying NPCs with the new smoother flight

This commit is contained in:
luisc committed 2022-02-27 23:23:41 -06:00
1 parent d2d3cef681
commit 65ab37158f
1 file changed
+12 -11
@@ -48,18 +48,19 @@ public abstract class EntityNPCFlying extends EntityNPCInterface {
}
}
if(heightOffGround > this.ai.flyHeightLimit && this.ai.hasFlyLimit){
super.moveEntityWithHeading(p_70612_1_,p_70612_2_);
return;
}
double d3 = this.motionY;
super.moveEntityWithHeading(p_70612_1_, p_70612_2_);
this.motionY = d3;
this.fallDistance = 0.0F;
this.velocityChanged = true;
if(this.getNavigator().noPath())
this.motionY = 0.0D;
if(heightOffGround < this.ai.flyHeightLimit || !this.ai.hasFlyLimit) {
double d3 = this.motionY;
super.moveEntityWithHeading(p_70612_1_, p_70612_2_);
this.motionY = d3;
this.fallDistance = 0.0F;
this.velocityChanged = true;
} else {
super.moveEntityWithHeading(p_70612_1_,p_70612_2_);
}
}
}