Merge pull request #192 from KAMKEEL/codex/fix-npc-gravity-issue-with-flying-gravity-0.0

Fix flying NPCs falling when gravity set to 0
This commit is contained in:
Kam authored and GitHub committed 2025-07-23 14:08:27 -04:00
commit 2d0d7ce615
1 file changed
+8
@@ -35,6 +35,14 @@ public abstract class EntityNPCFlying extends EntityNPCInterface {
return false;
}
@Override
public void onLivingUpdate() {
super.onLivingUpdate();
if (this.canFly() && this.getNavigator().noPath()) {
this.motionY = -Math.abs(this.ais.flyGravity);
}
}
public void moveEntityWithHeading(float p_70612_1_, float p_70612_2_) {
if (!this.canFly() || this.hurtTime != 0 || !this.canBreathe()) {
super.moveEntityWithHeading(p_70612_1_, p_70612_2_);