Issue: extracts entire resources from the assetsIndex when "map_to_resources" is set to true. That's expected but, the issue is it writes all the files every launch rather then skipping the files that already exist with their proper sha1 checksum. checksums are faster then extracting the files every launch.
Steps to reproduce:
launch < 1.6 jars
view launcher log it says extracting
notice it says in task manager 5.0+MB/s on the disk for 5-6s
repeat the process with the exact same files in the resource folder observe it does the same disk intensive process delaying startup time on SSD by 5s and HDD even more
How to fix:
get the hash of the asset which should be inside of the assetsIndex.json
compare the path's hash. if it exists and the hash matches the checksum sha1 then skip the extraction. For example "d68bae1949299ccd8297aaa423dd12e041e83773" to path: "newsound/ambient/weather/rain1.ogg". where the original sha1 is in the json comparing to the physical file in the path. if it doesn't match or the file doesn't exist override it
if the ms it takes is less you have fixed the issue. if it's more or the same on HDD drives then close this issue. But, I bet you sha1 checksums are faster then extracting the file each time to the path
also you probably know this already but, make sure to call File#exists before checking file hash as it's a faster process
Suggestion to speed up check even more on map to resources launch:
for offline file checks(files on your physical pc not the web) you could md5 to speed up the process it's unlikely people will attack their own pc with malwere to produce false hashes offline on the disk.
multi thread the hash check if you don't already do this
Thank you for your report!
However, this issue is Invalid.
You have posted a feature request or a suggestion. This site is for bug reports only.
For suggestions, please visit Minecraft Suggestions on Reddit or visit the Feedback website.
Quick Links:
📓 Bug Tracker Guidelines – 📧 Mojang Support
📓 Project Summary – ✍️ Feedback and Suggestions – 📖 Game Wiki