mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-30 14:33:56 +01:00
Add PathfinderGoalPanic for diff visibility.
This commit is contained in:
parent
f959530f6b
commit
ab36dbb6a9
41
src/main/java/net/minecraft/server/PathfinderGoalPanic.java
Normal file
41
src/main/java/net/minecraft/server/PathfinderGoalPanic.java
Normal file
@ -0,0 +1,41 @@
|
||||
package net.minecraft.server;
|
||||
|
||||
public class PathfinderGoalPanic extends PathfinderGoal {
|
||||
|
||||
private EntityCreature a;
|
||||
private double b;
|
||||
private double c;
|
||||
private double d;
|
||||
private double e;
|
||||
|
||||
public PathfinderGoalPanic(EntityCreature entitycreature, double d0) {
|
||||
this.a = entitycreature;
|
||||
this.b = d0;
|
||||
this.a(1);
|
||||
}
|
||||
|
||||
public boolean a() {
|
||||
if (this.a.getLastDamager() == null && !this.a.isBurning()) {
|
||||
return false;
|
||||
} else {
|
||||
Vec3D vec3d = RandomPositionGenerator.a(this.a, 5, 4);
|
||||
|
||||
if (vec3d == null) {
|
||||
return false;
|
||||
} else {
|
||||
this.c = vec3d.c;
|
||||
this.d = vec3d.d;
|
||||
this.e = vec3d.e;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void c() {
|
||||
this.a.getNavigation().a(this.c, this.d, this.e, this.b);
|
||||
}
|
||||
|
||||
public boolean b() {
|
||||
return !this.a.getNavigation().g();
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user