Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package net.minecraft.server.v1_12_R1;
- import com.google.common.base.Predicate;
- import com.google.common.base.Predicates;
- import java.util.List;
- public class PathfinderGoalAvoidTarget<T extends Entity>
- extends PathfinderGoal
- {
- private final Predicate<Entity> c = new PathfinderGoalAvoidTarget.1(this);
- protected EntityCreature a;
- private final double d;
- private final double e;
- protected T b;
- private final float f;
- private PathEntity g;
- private final NavigationAbstract h;
- private final Class<T> i;
- private final Predicate<? super T> j;
- public PathfinderGoalAvoidTarget(EntityCreature paramEntityCreature, Class<T> paramClass, float paramFloat, double paramDouble1, double paramDouble2)
- {
- this(paramEntityCreature, paramClass, Predicates.alwaysTrue(), paramFloat, paramDouble1, paramDouble2);
- }
- public PathfinderGoalAvoidTarget(EntityCreature paramEntityCreature, Class<T> paramClass, Predicate<? super T> paramPredicate, float paramFloat, double paramDouble1, double paramDouble2) {
- a = paramEntityCreature;
- i = paramClass;
- j = paramPredicate;
- f = paramFloat;
- d = paramDouble1;
- e = paramDouble2;
- h = paramEntityCreature.getNavigation();
- a(1);
- }
- public boolean a()
- {
- List localList = a.world.a(i, a.getBoundingBox().grow(f, 3.0D, f), Predicates.and(new Predicate[] { IEntitySelector.d, c, j }));
- if (localList.isEmpty()) {
- return false;
- }
- b = ((Entity)localList.get(0));
- Vec3D localVec3D = RandomPositionGenerator.b(a, 16, 7, new Vec3D(b.locX, b.locY, b.locZ));
- if (localVec3D == null) {
- return false;
- }
- if (b.d(x, y, z) < b.h(a)) {
- return false;
- }
- g = h.a(x, y, z);
- return g != null;
- }
- public boolean b()
- {
- return !h.o();
- }
- public void c()
- {
- h.a(g, d);
- }
- public void d()
- {
- b = null;
- }
- public void e()
- {
- if (a.h(b) < 49.0D) {
- a.getNavigation().a(e);
- } else {
- a.getNavigation().a(d);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment