The full-lotus position and zen (chan) and the middle way.
It wasn't about inflicting pain on the self on purpose. Pain is just part of the process, not the goal of the process.
The process of the practice is that you cultivate it, not enlighten in a day or in a session. You practice daily so you can reach that samadhi concentration (where all thoughts come to a stop; the mind is still; sounds pass your ears but you don't react or notice). And through that daily process, you are focusing on a single element until that samadhi concentration is reached and then the mind is still. In samadhi, there is no long the self, ego, others, etc.
The pain has to be overcome completely.
The Buddha's zen worked because of these major elements. He was able to focus on a single element and reach samadhi concentration. To stay in samadhi concentration, he was able to withstand the pains of meditation to the point that there was no distinctions between pain/comfort. In samadhi concentration, and being able to sit for so long, he reached the realizations of all things (enlightenment). Basically, during samadhi, he was tapping into Zen (chan). By focussing on zen (chan), the essence of all buddhas, and nothing else, he could only do one thing but become a buddha.
So for us who can only meditate 1 hour at a time, some 2 hours, and others more, we do it daily as a cultivation and practice until we can reach the point where meditation and stillness are unified without time, meaning, we can meditate for as long as we liked and there isn't any pain, obstruction, or distraction.
The Venerable Zen Master Hsuan Hua was able to do this, as he was constantly surrounded by disciples and many have witnessed his still meditation to last even weeks at a time unmoved and unstopped. His Chan (*ZEN) handbook is extremely good and illustrates all the points of the Buddha's meditation towards enlightenment. I am not a zen master so I can only answer surface-level.
But you should read the Handbook. The Master talks about techniques, concentration, mind obstacles, patience, vigor, mechanics, stages and effects, sensations, samadhi.
People study his teachings on zen because those who cultivate, can affirm his teachings. For example, the stages that a novice experiences, the master has already talked about. The stages an intermediate enters, are already described and illustrated by the master. And for those who can meditate about 8 hours at a time, affirm what the master said. And the master has discussed beyond that too. He was a living testimony of those teachings.
ZEN HANDBOOK, by Venerable Master Hsuan Hua
http://www.gbm-online.com/dharma/the_chan_handbook.pdf
Dharma Talk and Lecture Compilations on the Venerable Master Hua.
**just search the page for "Chan" or "medit" to locate all the lectures that the Master spoke on meditation.
http://www.gbm-online.com/dharma/the_chan_handbook.pdf
Lecture series during the winter meditation sessions.
http://cttbusa.org/listen/listen2_21.asp