mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-12 03:47:27 +00:00
Fixed flying limits not working on flying NPCs with the new smoother flight
This commit is contained in:
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_);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user