diff --git a/src/main/java/noppes/npcs/entity/EntityNPCFlying.java b/src/main/java/noppes/npcs/entity/EntityNPCFlying.java index d57d89b4f..e588e2f93 100644 --- a/src/main/java/noppes/npcs/entity/EntityNPCFlying.java +++ b/src/main/java/noppes/npcs/entity/EntityNPCFlying.java @@ -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_); - } } }