public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4)
    {
        int i = par1World.getBlockId(par2, par3 - 1, par4);

        if (i == blockID)
        {
            return true;
        }

        if (i != Block.grass.blockID && i != Block.dirt.blockID && i != Block.sand.blockID)
        {
            return false;
        }

        if (par1World.getBlockMaterial(par2 - 1, par3 - 1, par4) == Material.water)
        {
            return true;
        }

        if (par1World.getBlockMaterial(par2 + 1, par3 - 1, par4) == Material.water)
        {
            return true;
        }

        if (par1World.getBlockMaterial(par2, par3 - 1, par4 - 1) == Material.water)
        {
            return true;
        }

        return par1World.getBlockMaterial(par2, par3 - 1, par4 + 1) == Material.water;
    }