Skip to content
Permalink
Browse files

Don't randomly chase things we can't even see, fixes #25

Not sure what that code was meant to accomplish.
  • Loading branch information...
mcmonkey4eva committed May 8, 2016
1 parent 2f88d4e commit 20bab5b9de755c9a6cf310093e63f54894df2740
Showing with 0 additions and 13 deletions.
  1. +0 −13 src/main/java/org/mcmonkey/sentinel/SentinelTrait.java
@@ -988,19 +988,6 @@ public LivingEntity findBestTarget() {
closest = ent;
}
}
if (closest == null) {
// NOTE: Possibly can be optimized by retrieving a list from the above logic?
for (LivingEntity ent: getLivingEntity().getWorld().getLivingEntities()) {
if ((ignoreGlow && ent.isGlowing()) || ent.isDead()) {
continue;
}
double dist = ent.getEyeLocation().distanceSquared(pos);
if (dist < rangesquared && shouldTarget(ent)) {
rangesquared = dist;
closest = ent;
}
}
}
return closest;
}

0 comments on commit 20bab5b

Please sign in to comment.
You can’t perform that action at this time.