mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-12-27 11:37:42 +01:00
Fix debug pathfinding
This commit is contained in:
parent
8ff4d336ff
commit
66a07f8f05
@ -68,15 +68,17 @@ public class AStarNavigationStrategy extends AbstractPathStrategy {
|
||||
double xzDistance = dX * dX + dZ * dZ;
|
||||
double distance = xzDistance + dY * dY;
|
||||
if (Setting.DEBUG_PATHFINDING.asBoolean()) {
|
||||
for (int i = 0; i < 5; i++) {
|
||||
npc.getEntity().getWorld().playEffect(npc.getStoredLocation(), Effect.MOBSPAWNER_FLAMES, 0);
|
||||
for (int i = 0; i < 3; i++) {
|
||||
npc.getEntity().getWorld()
|
||||
.playEffect(vector.toLocation(npc.getEntity().getWorld()), Effect.ENDER_SIGNAL, 0);
|
||||
}
|
||||
}
|
||||
if (distance > 0 && dY > 0 && xzDistance <= 2.75) {
|
||||
if (distance > 0 && dY > 0 && dY < 1 && xzDistance <= 2.75) {
|
||||
NMS.setShouldJump(npc.getEntity());
|
||||
}
|
||||
NMS.setDestination(npc.getEntity(), vector.getX(), vector.getY(), vector.getZ(), params.speed());
|
||||
params.tick();
|
||||
params.run();
|
||||
plan.run(npc);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -80,7 +80,8 @@ public class FlyingAStarNavigationStrategy extends AbstractPathStrategy {
|
||||
|
||||
NMS.setVerticalMovement(npc.getEntity(), 0.5);
|
||||
NMS.setHeadYaw(NMS.getHandle(npc.getEntity()), current.getYaw() + normalisedTargetYaw);
|
||||
parameters.tick();
|
||||
parameters.run();
|
||||
plan.run(npc);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -59,7 +59,7 @@ public class MCNavigationStrategy extends AbstractPathStrategy {
|
||||
return true;
|
||||
navigation.a(parameters.avoidWater());
|
||||
navigation.a(parameters.speed());
|
||||
parameters.tick();
|
||||
parameters.run();
|
||||
return NMS.isNavigationFinished(navigation);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user