From a466e0aa6c0e1352fc69b9520c6b70129b11e018 Mon Sep 17 00:00:00 2001 From: EvilSeph Date: Thu, 1 Aug 2013 22:13:25 -0400 Subject: [PATCH] Add timeout for Panic goal. Fixes BUKKIT-4531 --- src/main/java/net/minecraft/server/PathfinderGoalPanic.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main/java/net/minecraft/server/PathfinderGoalPanic.java b/src/main/java/net/minecraft/server/PathfinderGoalPanic.java index d58911e48b..cbf1976ca2 100644 --- a/src/main/java/net/minecraft/server/PathfinderGoalPanic.java +++ b/src/main/java/net/minecraft/server/PathfinderGoalPanic.java @@ -36,6 +36,12 @@ public class PathfinderGoalPanic extends PathfinderGoal { } public boolean b() { + // CraftBukkit start - introduce a temporary timeout hack until this is fixed properly + if ((this.a.ticksLived - this.a.aE()) > 100) { + this.a.b((EntityLiving) null); + return false; + } + // CraftBukkit end return !this.a.getNavigation().g(); } }