mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-18 04:35:03 +00:00
Smoother + Most-Cost Effective Flight Pathing
This commit is contained in:
1 parent
960b223155
commit
a79ba3a0e4
3 files changed
+114
-14
No files matched your search
@@ -91,11 +91,13 @@ public abstract class EntityNPCFlying extends EntityNPCInterface {
|
||||
this.prevLimbSwingAmount = this.limbSwingAmount;
|
||||
double distanceX = this.posX - this.prevPosX;
|
||||
double distanceZ = this.posZ - this.prevPosZ;
|
||||
float distance = MathHelper.sqrt_double(distanceX * distanceX + distanceZ * distanceZ) * 4.0F;
|
||||
float distance = MathHelper.sqrt_double(distanceX * distanceX + distanceZ * distanceZ);
|
||||
float swingScale = this.getNavigator().noPath() ? 0.35F : 0.9F;
|
||||
distance *= swingScale;
|
||||
if (distance > 1.0F) {
|
||||
distance = 1.0F;
|
||||
}
|
||||
this.limbSwingAmount += (distance - this.limbSwingAmount) * 0.4F;
|
||||
this.limbSwingAmount += (distance - this.limbSwingAmount) * 0.18F;
|
||||
this.limbSwing += this.limbSwingAmount;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user