public boolean shouldExecute()
    {
        this.func_48286_h();

        if (this.field_48289_e && this.theEntity.worldObj.isDaytime())
        {
            return false;
        }
        else
        {
            Village var1 = this.theEntity.worldObj.villageCollectionObj.findNearestVillage(MathHelper.floor_double(this.theEntity.posX), MathHelper.floor_double(this.theEntity.posY), MathHelper.floor_double(this.theEntity.posZ), 0);

            if (var1 == null)
            {
                return false;
            }
            else
            {
                this.doorInfo = this.func_48284_a(var1);

                if (this.doorInfo == null)
                {
                    return false;
                }
                else
                {
                    boolean var2 = this.theEntity.getNavigator().getCanBreakDoors();
                    this.theEntity.getNavigator().setBreakDoors(false);
                    this.field_48291_c = this.theEntity.getNavigator().getPathToXYZ((double)this.doorInfo.posX, (double)this.doorInfo.posY, (double)this.doorInfo.posZ);
                    this.theEntity.getNavigator().setBreakDoors(var2);

                    if (this.field_48291_c != null)
                    {
                        return true;
                    }
                    else
                    {
                        Vec3D var3 = RandomPositionGenerator.func_48620_a(this.theEntity, 10, 7, Vec3D.createVector((double)this.doorInfo.posX, (double)this.doorInfo.posY, (double)this.doorInfo.posZ));

                        if (var3 == null)
                        {
                            return false;
                        }
                        else
                        {
                            this.theEntity.getNavigator().setBreakDoors(false);
                            this.field_48291_c = this.theEntity.getNavigator().getPathToXYZ(var3.xCoord, var3.yCoord, var3.zCoord);
                            this.theEntity.getNavigator().setBreakDoors(var2);
                            return this.field_48291_c != null;
                        }
                    }
                }
            }
        }
    }