From 8873705ce7d0e37664f35b4be29c85666bb25c81 Mon Sep 17 00:00:00 2001 From: Kam Date: Sat, 21 Feb 2026 15:28:59 -0500 Subject: [PATCH] Fix Some Flying Logic --- .../noppes/npcs/entity/EntityNPCFlying.java | 26 ++++++++++--------- 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/src/main/java/noppes/npcs/entity/EntityNPCFlying.java b/src/main/java/noppes/npcs/entity/EntityNPCFlying.java index 18c730dd3..8c062fdda 100644 --- a/src/main/java/noppes/npcs/entity/EntityNPCFlying.java +++ b/src/main/java/noppes/npcs/entity/EntityNPCFlying.java @@ -62,15 +62,16 @@ public abstract class EntityNPCFlying extends EntityNPCInterface { } else if (heightOffGround > this.ais.flyHeightLimit) { aboveLimit = true; } - if (aboveLimit && this.ais.hasFlyLimit || (heightOffGround < Math.ceil(this.height) && this.motionY == 0)) { + if (aboveLimit && this.ais.hasFlyLimit) { this.flyLimitAllow = false; - if (!this.getNavigator().noPath() && this.motionY > 0) { + if (this.motionY > 0) { this.motionY = 0; - } else { - setNpcFlyingState(false); - super.moveEntityWithHeading(p_70612_1_, p_70612_2_); - return; } + } else if (heightOffGround < Math.ceil(this.height) && this.motionY == 0) { + this.flyLimitAllow = false; + setNpcFlyingState(false); + super.moveEntityWithHeading(p_70612_1_, p_70612_2_); + return; } this.flyLimitAllow = true; setNpcFlyingState(true); @@ -120,15 +121,16 @@ public abstract class EntityNPCFlying extends EntityNPCInterface { } else if (heightOffGround > this.ais.flyHeightLimit) { aboveLimit = true; } - if (aboveLimit && this.ais.hasFlyLimit || (heightOffGround < Math.ceil(this.height) && this.motionY == 0)) { + if (aboveLimit && this.ais.hasFlyLimit) { this.flyLimitAllow = false; - if (!this.getNavigator().noPath() && this.motionY > 0) { + if (this.motionY > 0) { this.motionY = 0; - } else { - setNpcFlyingState(false); - super.performMountedMovement(strafe, forward, moveSpeed); - return; } + } else if (heightOffGround < Math.ceil(this.height) && this.motionY == 0) { + this.flyLimitAllow = false; + setNpcFlyingState(false); + super.performMountedMovement(strafe, forward, moveSpeed); + return; } this.flyLimitAllow = true; setNpcFlyingState(true);