Investigation of the shear failure of rock joints using the four-dimensional lattice spring model