{
if (!(entry instanceof EntityCreature))
{
continue;
}
EntityCreature e = (EntityCreature) entry;
//Check whether the mob can actually *see* the arclamp tile
//if (this.worldObj.func_147447_a(thisPos, Vec3.createVectorHelper(e.posX, e.posY, e.posZ), true, true, false) != null) continue;
Vec3 vecNewTarget = RandomPositionGenerator.findRandomTargetBlockAwayFrom(e, 16, 7, this.thisPos);
if (vecNewTarget == null)
{
continue;
}
PathNavigate nav = e.getNavigator();
if (nav == null)
{
continue;
}
Vec3 vecOldTarget = null;
if (nav.getPath() != null && !nav.getPath().isFinished())
{
vecOldTarget = nav.getPath().getPosition(e);
}
double distanceNew = vecNewTarget.squareDistanceTo(this.xCoord, this.yCoord, this.zCoord);
if (distanceNew > e.getDistanceSq(this.xCoord, this.yCoord, this.zCoord))
{
if (vecOldTarget == null || distanceNew > vecOldTarget.squareDistanceTo(this.xCoord, this.yCoord, this.zCoord))
{
e.getNavigator().tryMoveToXYZ(vecNewTarget.xCoord, vecNewTarget.yCoord, vecNewTarget.zCoord, 0.3D);
//System.out.println("Debug: Arclamp repelling entity: "+e.getClass().getSimpleName());
}
}
}
}