It's actually
TextureMap#getResourceLocation
that adds the prefix and extension to your
ResourceLocation
before loading the texture.
ResourceLocation
is used for many things that aren't textures, so it wouldn't make much sense if it added the prefix and file extension automatically.