I couldn't run the jar however as I'm using JRE 1.6
I copied the code into Eclipse. When I tried to run the code however I got the following exception:
Attempting To Dump Login File at C:\Users\xxx\.minecraft java.io.FileNotFoundException: C:\Users\xxx\.minecraft\lastlogin (The system cannot find the path specified) [*] Dump failed! No idea why, check the trace. at java.io.FileInputStream.open(Native Method) at java.io.FileInputStream.<init>(Unknown Source) at dump.DumpContents(dump.java:63) at dump.main(dump.java:48)
It seems it's looking for the file at path C:\Users\xxx\.minecraft while it should be looking at C:\Users\xxx\AppData\Roaming\.minecraft
After debugging I found out that the osType.ordinal() call was returning 2 and therefore uses this code
Directory = new File(userHome, '.' + applicationName + '/');
The code at case 3 however will return the correct path.
I edited the code at the case 2 to look like this:
case 2: //Directory = new File(userHome, '.' + applicationName + '/'); String applicationData2 = System.getenv("APPDATA"); if (applicationData2 != null) Directory = new File(applicationData2, "." + applicationName + '/'); else Directory = new File(userHome, '.' + applicationName + '/'); break;
This will return the correct path and works fine.
I'm using Windows 7 x64. I haven't tested this at any other OS but you might want to look into this.
I'm not to familiar with Java, especially with the enum types. But given the documentation popping up within Eclipse on the ordinal() method I might have found a bug.
It starts with an index of 0, while your code starts at 1 and ends at 4. Shouldn't the case checks start at 0 and end on 3?
Well I hope this information was in any way useful to you.
I found this to and posted an issue on the github aswell.