diff options
author | EvilSeph <evilseph@gmail.com> | 2013-08-01 22:07:36 -0400 |
---|---|---|
committer | EvilSeph <evilseph@gmail.com> | 2013-08-02 19:20:25 -0400 |
commit | ab36dbb6a937ffa61f76716cddf0fb40070b8d35 (patch) | |
tree | 4699e9226a70272bcf43a9fd3e82bde0182be2b1 /src/main/java | |
parent | f959530f6b60c8dd1b4c514b38cd01382144b5ee (diff) | |
download | craftbukkit-ab36dbb6a937ffa61f76716cddf0fb40070b8d35.tar craftbukkit-ab36dbb6a937ffa61f76716cddf0fb40070b8d35.tar.gz craftbukkit-ab36dbb6a937ffa61f76716cddf0fb40070b8d35.tar.lz craftbukkit-ab36dbb6a937ffa61f76716cddf0fb40070b8d35.tar.xz craftbukkit-ab36dbb6a937ffa61f76716cddf0fb40070b8d35.zip |
Add PathfinderGoalPanic for diff visibility.
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/net/minecraft/server/PathfinderGoalPanic.java | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/src/main/java/net/minecraft/server/PathfinderGoalPanic.java b/src/main/java/net/minecraft/server/PathfinderGoalPanic.java new file mode 100644 index 00000000..d58911e4 --- /dev/null +++ b/src/main/java/net/minecraft/server/PathfinderGoalPanic.java @@ -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(); + } +} |