private float func_1224_a(int i, int j, int k, Material material) {
        int l = 0;
        float f = 0.0F;

        for (int i1 = 0; i1 < 4; ++i1) {
            int j1 = i - (i1 & 1);
            int l1 = k - (i1 >> 1 & 1);

            if (this.blockAccess.getBlockMaterial(j1, j + 1, l1) == material) {
                return 1.0F;
            }

            Material material1 = this.blockAccess.getBlockMaterial(j1, j, l1);

            if (material1 == material) {
                int i2 = this.blockAccess.getBlockMetadata(j1, j, l1);

                if (i2 >= 8 || i2 == 0) {
                    f += BlockFluid.getFluidHeightPercent(i2) * 10.0F;
                    l += 10;
                }

                f += BlockFluid.getFluidHeightPercent(i2);
                ++l;
            } else if (!material1.isSolid()) {
                ++f;
                ++l;
            }
        }

        return 1.0F - f / (float) l;
    }