Respect distanceMargin when NPCs are passively moving towards entities

This commit is contained in:
fullwall 2015-01-04 20:51:21 +08:00
parent 95993348bd
commit c1321c2162

View File

@ -114,7 +114,9 @@ public class MCTargetStrategy implements PathStrategy, EntityTarget {
if (cancelReason != null) {
return true;
}
if (target.world.getWorld().getFullTime() % 10 == 0) {
if (!aggro && distanceSquared() < parameters.distanceMargin()) {
stop();
} else if (target.world.getWorld().getFullTime() % 10 == 0) {
setPath();
}
NMS.look(handle, target);