More fixes for flight pathing

This commit is contained in:
Luis C.M committed 2022-05-15 01:21:06 -05:00
1 parent 44459a23a7
commit 1f79b52176
4 files changed
+6 -6

No files matched your search

@@ -324,7 +324,7 @@ public class FlyPathFinder extends PathFinder
if(block == Blocks.air)
{
boolean heightClear = true;
for (int currentY = blockY; currentY < Math.ceil(blockY + entity.height); ++currentY) {
for (int currentY = blockY; currentY <= Math.ceil(blockY + entity.height); ++currentY) {
Block b = entity.worldObj.getBlock(l, currentY, j1);
if (b != Blocks.air) {
heightClear = false;
@@ -54,6 +54,9 @@ public class FlyingMoveHelper extends EntityMoveHelper{
if (heightOffGround < this.entity.ai.flyHeightLimit || !this.entity.ai.hasFlyLimit) {
this.entity.motionY = verticalSpeed * (d1 / d5);
if (this.entity.motionY > 0) {
this.entity.motionY += 0.1D;
}
}
this.entity.velocityChanged = true;
@@ -226,7 +226,7 @@ public class PathNavigateFlying extends PathNavigate {
if (vec3 != null)
{
this.theEntity.getMoveHelper().setMoveTo(vec3.xCoord, vec3.yCoord + 0.5D, vec3.zCoord, this.speed);
this.theEntity.getMoveHelper().setMoveTo(vec3.xCoord, vec3.yCoord, vec3.zCoord, this.speed);
}
}
}
@@ -48,7 +48,7 @@ public abstract class EntityNPCFlying extends EntityNPCInterface {
}
}
if(heightOffGround > this.ai.flyHeightLimit && this.ai.hasFlyLimit){
if (heightOffGround > this.ai.flyHeightLimit && this.ai.hasFlyLimit) {
super.moveEntityWithHeading(p_70612_1_,p_70612_2_);
return;
}
@@ -57,9 +57,6 @@ public abstract class EntityNPCFlying extends EntityNPCInterface {
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;
}