The code works for any floor: block, sprite, model or terrain. It distinguishes the kind of object the character is walking on, and acts in a different way to detect the type of surface.
In blocks, you use surface flags or the texture name. In models and terrains, you add a RGB soundmap skin. Sprites also use they flags or their sprite (image) filename. All this is in the explanation above.