Commit 3cbbf26c by Jonathan Thomas

Fixing FuzzyTargeting on LEAD behavior to move towards the general random point

parent 06514055
Pipeline #12711 passed with stages
in 1 minute 56 seconds
...@@ -97,7 +97,6 @@ public class LeadPlayerGoal extends PlayerBaseGoal { ...@@ -97,7 +97,6 @@ public class LeadPlayerGoal extends PlayerBaseGoal {
Path path = this.entity.getNavigation().findPathTo(this.currentTarget.x, this.currentTarget.y, this.currentTarget.z, 1); Path path = this.entity.getNavigation().findPathTo(this.currentTarget.x, this.currentTarget.y, this.currentTarget.z, 1);
if (path != null) { if (path != null) {
LOGGER.info("Start moving towards waypoint PATH");
this.entity.getNavigation().startMovingAlong(path, this.speed); this.entity.getNavigation().startMovingAlong(path, this.speed);
} else { } else {
......
...@@ -24,10 +24,10 @@ public class RandomTargetFinder { ...@@ -24,10 +24,10 @@ public class RandomTargetFinder {
Vec3d target = getTargetInDirection(entity, constrainedDirection, minDistance, maxDistance); Vec3d target = getTargetInDirection(entity, constrainedDirection, minDistance, maxDistance);
if (entity instanceof PathAwareEntity) { if (entity instanceof PathAwareEntity) {
Vec3d validTarget = FuzzyTargeting.findFrom((PathAwareEntity) entity, (int) maxDistance, (int) maxDistance / 2, target); Vec3d validTarget = FuzzyTargeting.findTo((PathAwareEntity) entity, (int) maxDistance, (int) maxDistance, target);
if (validTarget != null && isWithinDistance(entityPos, validTarget, minDistance, maxDistance)) { if (validTarget != null && isWithinDistance(entityPos, validTarget, minDistance, maxDistance)) {
Path path = entity.getNavigation().findPathTo(validTarget.x, validTarget.y, validTarget.z, 1); Path path = entity.getNavigation().findPathTo(validTarget.x, validTarget.y, validTarget.z, 4);
if (path != null) { if (path != null) {
return validTarget; return validTarget;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment