35 lines
1.3 KiB
Diff
35 lines
1.3 KiB
Diff
--- a/net/minecraft/world/entity/ai/goal/PathfinderGoalPanic.java
|
|
+++ b/net/minecraft/world/entity/ai/goal/PathfinderGoalPanic.java
|
|
@@ -11,6 +11,10 @@
|
|
import net.minecraft.world.level.IBlockAccess;
|
|
import net.minecraft.world.phys.Vec3D;
|
|
|
|
+// CraftBukkit start
|
|
+import net.minecraft.world.entity.EntityLiving;
|
|
+// CraftBukkit end
|
|
+
|
|
public class PathfinderGoalPanic extends PathfinderGoal {
|
|
|
|
public static final int WATER_CHECK_DISTANCE_VERTICAL = 1;
|
|
@@ -77,6 +81,12 @@
|
|
|
|
@Override
|
|
public boolean canContinueToUse() {
|
|
+ // CraftBukkit start - introduce a temporary timeout hack until this is fixed properly
|
|
+ if ((this.mob.tickCount - this.mob.lastHurtByMobTimestamp) > 100) {
|
|
+ this.mob.setLastHurtByMob((EntityLiving) null);
|
|
+ return false;
|
|
+ }
|
|
+ // CraftBukkit end
|
|
return !this.mob.getNavigation().isDone();
|
|
}
|
|
|
|
@@ -86,6 +96,6 @@
|
|
|
|
return !iblockaccess.getBlockState(blockposition).getCollisionShape(iblockaccess, blockposition).isEmpty() ? null : (BlockPosition) BlockPosition.findClosestMatch(entity.blockPosition(), i, 1, (blockposition1) -> {
|
|
return iblockaccess.getFluidState(blockposition1).is((Tag) TagsFluid.WATER);
|
|
- }).orElse((Object) null);
|
|
+ }).orElse(null); // CraftBukkit - decompile error
|
|
}
|
|
}
|