Mojang/LegacyLauncher — pull request #4 by jk-5 (2013-10-10 16:47:08+00:00)
Title: Fixed gamedir change being injected too low

I wanted to move all my modded setups to the new launcher, so i made a profile for 1.5.2 with forge and chose a different runtime folder. I started the game and all files appeared in the default folder. I taught that this was a fault of the mods, so i tried it with an clean 1.5.2 profile. Same error here.

There are 2 files that do appear in the new profile directory, and that are the debug.stitched_items.png and debug.stitched_blocks.png files.

I enabled the launchwrapper class save option (-Dlegacy.debugClassLoadingSave=true) and decompiled the net.minecraft.client.Minecraft class from that.
In there, i saw the problem. The game dir is injected at the end of the main method. After the game is actually started and loaded.
I moved this injection up to the top of the main method. This fixed the problem

If you want the proof, ask me for screenshots or test it yourself

I have not tested yet if this problem exists for Indev and Alpha too, if it does, i will update this PR