mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-18 20:49:05 +00:00
More fixes to flight pathing:
PathNavigateFlying: Flight pathing checks if it's stuck every 10 ticks now, and clears the path to be able to path again if so. FlyPathFinder: If a point on the path is air, the path finder checks if the NPC will run into any blocks above that point due to its height.
This commit is contained in:
1 parent
f9f73a75d2
commit
44459a23a7
2 files changed
+12
-2
No files matched your search
@@ -323,7 +323,17 @@ public class FlyPathFinder extends PathFinder
|
||||
|
||||
if(block == Blocks.air)
|
||||
{
|
||||
return 2;
|
||||
boolean heightClear = true;
|
||||
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;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (heightClear) {
|
||||
return 2;
|
||||
}
|
||||
}
|
||||
|
||||
if (block == Blocks.trapdoor)
|
||||
|
||||
@@ -261,7 +261,7 @@ public class PathNavigateFlying extends PathNavigate {
|
||||
}
|
||||
}
|
||||
|
||||
if (this.totalTicks - this.ticksAtLastPos > 50)
|
||||
if (this.totalTicks - this.ticksAtLastPos > 10)
|
||||
{
|
||||
if (vec3.squareDistanceTo(this.lastPosCheck) < 2.25D)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user