Skip to content

Commit

Permalink
Fix debug pathfinding
Browse files Browse the repository at this point in the history
  • Loading branch information
fullwall committed Jan 12, 2014
1 parent 1419efd commit 28a8034
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
Expand Up @@ -68,15 +68,17 @@ public boolean update() {
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;
}

Expand Down
Expand Up @@ -80,7 +80,8 @@ public boolean update() {

NMS.setVerticalMovement(npc.getEntity(), 0.5);
NMS.setHeadYaw(NMS.getHandle(npc.getEntity()), current.getYaw() + normalisedTargetYaw);
parameters.tick();
parameters.run();
plan.run(npc);
return false;
}

Expand Down
Expand Up @@ -59,7 +59,7 @@ public boolean update() {
return true;
navigation.a(parameters.avoidWater());
navigation.a(parameters.speed());
parameters.tick();
parameters.run();
return NMS.isNavigationFinished(navigation);
}
}

0 comments on commit 28a8034

Please sign in to comment.