I noticed that my stats reset when I launched 1.4 for the first time. Luckily I keep backups, and had a backup from three days ago. I decided to look into the issue to see if I couldn't figure out why they were resetting.
If you need/want to know how the whole statistics storage system works:
Each stat is stored in this format: {"[stat id]":[stat value]}. So 26 "Worlds loaded", whose id is 1002, would be stored like this: {"1002":26}.
Basic stats have ids around 1000-2000, achievements start with 5, and blocks mined statistics start with 16. For more information about how ids are calculated, look here
Inside minecraft.jar there is a file called map.txt, which stores a list of every statistic/achievement id, and an associated MD5 hash.
There is a checksum value stored in the dat file as well, which is calculated as follows:
Create a string. First, start with the sessionid, which is stored in the dat file. Currently, it is always "local".
Then, for each statistic, add the MD5 associated with its id from map.txt, a comma, the value of the statistic, and another comma. Leave the trailing comma. So if your only statistic is 26 worlds loaded, the string would be:
locald517ae73160fd8576d7687ead1c1a973,26,
(the MD5 associated with worlds loaded/1002 is "d517ae73160fd8576d7687ead1c1a973")
Then just take the MD5 of that string and use that as your "checksum" value.
Now, on to the actual problem. If I only use basic statistics (the ones with 4-digit IDs), everything works fine and nothing is reset. If I only use all of the achievements, it resets. I figured out that map.txt doesn't include MD5 hashes for any achievements with an ID greater than 5242895, which seems to be everything added after achievements were originally implemented, such as ones for enchanting and The End. Removing these achievements allowed the rest to work fine.
I have no idea how the checksum is calculated when there is no associated MD5 in map.txt. I tried using '0' and nothing for the MD5, but neither worked.
Other statistics that don't have an associated MD5 in map.txt seem to be any block implemented after the system was originally introduced, such as Watermelon blocks mined.
Obviously Minecraft knows how to handle these, since those new achievements and blocks were saved just fine before 1.4. But why do the stats reset with 1.4 all of a sudden? If I can figure out how to handle missing MD5 hashes, I can just manually recreate the dat file and keep all of my pre-1.4 statistics.
Your information have been very helpful building a small website* that calculates the hash using the map.txt file. I know, it's not much and you lose some of the Achievements and Stats as well... But better than lose everything, right? And for that actually not a bad workaround until minecraft could transfer the Stats properly.
Keep hoping and praying ...
Edit 15. November 2013:
*As of Minecraft 1.7.2, the Stats will reset again (or better: won't be loaded into the game). For this reason, I've recreated and rehosted that outdated site completely. You can find the new one here. Get more informations here: [Webtool] Achievements/Stats transformer and editor [English/Deutsch]!
I let the old one up, until I get the new one to backport stats.
Hell yeah! I'm nearly asleep but I've found the missing part!
tony331, '0' was correct, but "non existing" things answering 'null', not '0'...
So, local[hash],[value] will be...: localnull,1,null,1,... And for everything other use the map.txt.
I'll update and debug my MD5-Generator-Website tomorrow (maybe there is something cousing a reset again, I don't know), I'm really too tired to do this right now.
Thank you guys .
Edit (awake):
I've read somewhere, that they tweaked something around "stairs" in the Stats... Let's see...
"Worlds played" and(sorry, I did the test wrong) "Saves loaded" seem to causing a reset, but there's still an other "reseter"... I'm a bit confused... Sometimes it works, sometimes not .
Every time you install a mod or download a snapshot or prerelease, an installed mod resets the stats and if you install a snapshot, it would overwrite all data.
If you need/want to know how the whole statistics storage system works:
Each stat is stored in this format: {"[stat id]":[stat value]}. So 26 "Worlds loaded", whose id is 1002, would be stored like this: {"1002":26}.
Basic stats have ids around 1000-2000, achievements start with 5, and blocks mined statistics start with 16. For more information about how ids are calculated, look here
Inside minecraft.jar there is a file called map.txt, which stores a list of every statistic/achievement id, and an associated MD5 hash.
There is a checksum value stored in the dat file as well, which is calculated as follows:
Create a string. First, start with the sessionid, which is stored in the dat file. Currently, it is always "local".
Then, for each statistic, add the MD5 associated with its id from map.txt, a comma, the value of the statistic, and another comma. Leave the trailing comma. So if your only statistic is 26 worlds loaded, the string would be:
locald517ae73160fd8576d7687ead1c1a973,26,
(the MD5 associated with worlds loaded/1002 is "d517ae73160fd8576d7687ead1c1a973")
Then just take the MD5 of that string and use that as your "checksum" value.
Now, on to the actual problem. If I only use basic statistics (the ones with 4-digit IDs), everything works fine and nothing is reset. If I only use all of the achievements, it resets. I figured out that map.txt doesn't include MD5 hashes for any achievements with an ID greater than 5242895, which seems to be everything added after achievements were originally implemented, such as ones for enchanting and The End. Removing these achievements allowed the rest to work fine.
I have no idea how the checksum is calculated when there is no associated MD5 in map.txt. I tried using '0' and nothing for the MD5, but neither worked.
Other statistics that don't have an associated MD5 in map.txt seem to be any block implemented after the system was originally introduced, such as Watermelon blocks mined.
Obviously Minecraft knows how to handle these, since those new achievements and blocks were saved just fine before 1.4. But why do the stats reset with 1.4 all of a sudden? If I can figure out how to handle missing MD5 hashes, I can just manually recreate the dat file and keep all of my pre-1.4 statistics.
I know, it's not much and you lose some of the Achievements and Stats as well... But better than lose everything, right? And for that actually not a bad workaround until minecraft could transfer the Stats properly.Keep hoping and praying
Edit 15. November 2013:
*As of Minecraft 1.7.2, the Stats will reset again (or better: won't be loaded into the game). For this reason, I've recreated and rehosted that outdated site completely. You can find the new one here. Get more informations here: [Webtool] Achievements/Stats transformer and editor [English/Deutsch]!
I let the old one up, until I get the new one to backport stats.
"Java is for me the eighth Wonder of the World: It's a wonder if it works and I'm wondering if it doesn't work." -Valares
Nope, they didn't done (until now) from version to version, they get ONLY reset when using Pre-releases (or installing some mods)...
"Java is for me the eighth Wonder of the World: It's a wonder if it works and I'm wondering if it doesn't work." -Valares
tony331, '0' was correct, but "non existing" things answering 'null', not '0'...
So, local[hash],[value] will be...: localnull,1,null,1,... And for everything other use the map.txt.
I'll update and debug my MD5-Generator-Website tomorrow (maybe there is something cousing a reset again, I don't know), I'm really too tired to do this right now.
Thank you guys
Edit (awake):
I've read somewhere, that they tweaked something around "stairs" in the Stats... Let's see...
"Worlds played" and(sorry, I did the test wrong) "Saves loaded" seem to causing a reset, but there's still an other "reseter"...I'm a bit confused... Sometimes it works, sometimes not"Java is for me the eighth Wonder of the World: It's a wonder if it works and I'm wondering if it doesn't work." -Valares
I hope, that was the only problem. Uffa.
Again, this little program* should fix your Achievements/Stats. If not, please send me a message. Thanks.
I would be glad if someone with access to Mojira could update the Bugreport...
Edit 15. November 2013:
*Replaced outdated site with new one. Get more informations here: [Webtool] Achievements/Stats transformer and editor [English/Deutsch]!
"Java is for me the eighth Wonder of the World: It's a wonder if it works and I'm wondering if it doesn't work." -Valares