minecraft: no longer assume constant assetIndex

This commit is contained in:
Phantop 2023-06-01 00:12:20 -04:00
parent 9bc1e3ddf7
commit 8d046de353
1 changed files with 3 additions and 3 deletions

View File

@ -2,12 +2,12 @@
if mkdir objects; then
d=$(curl https://piston-meta.mojang.com/mc/game/version_manifest.json | jq -r .versions[0].url)
wget "$(curl "$d" | jq -r .assetIndex.url)" -P indexes
jq -r .objects[].hash < indexes/3.json | sed 's#^\(..\)#https://resources.download.minecraft.net/\1/\1#' | xargs aria2c -d objects -Z
cat indexes/*.json | jq -r .objects[].hash | sed 's#^\(..\)#https://resources.download.minecraft.net/\1/\1#' | xargs aria2c -d objects -Z
( echo "cd objects"; printf "mkdir %02x; mv %02x* %02x\n" $(seq 0 255 | sed 'p;p') ) | sh
curl "$d" | jq .libraries[].downloads.artifact.url,.downloads.client.url | grep -vE 'windows|macos' | xargs aria2c -d objects -Z
d="https://meta.fabricmc.net/v2/versions/loader/$(curl "$d" | jq -r .id)"
d=$(curl "$d/$(curl "$d" | jq -r .[0].loader.version)/profile/json" | jq -r .libraries[].name)
echo "$d" | sed -r ':b;s|^([^:]*)*\.|\1\/|;tb;s|(.*):(.*):(.*)|https://maven.fabricmc.net/\1/\2/\3/\2-\3.jar|g' | xargs aria2c -d objects -Z
fi
java -XX:+UnlockExperimentalVMOptions -XX:+UseG1GC -XX:G1NewSizePercent=20 -XX:G1ReservePercent=20 -XX:MaxGCPauseMillis=50 -XX:G1HeapRegionSize=32M\
-Xms1G -Xmx8G -cp 'objects/*' net.fabricmc.loader.impl.launch.knot.KnotClient --version . --assetsDir . --assetIndex 3 --accessToken 0 "$@"
java -XX:+UnlockExperimentalVMOptions -XX:+UseG1GC -XX:G1NewSizePercent=20 -XX:G1ReservePercent=20 -XX:MaxGCPauseMillis=50 -XX:G1HeapRegionSize=32M -Xms1G -Xmx8G\
-cp 'objects/*' net.fabricmc.loader.impl.launch.knot.KnotClient --version . --assetsDir . --assetIndex "$(basename indexes/*.json .json)" --accessToken 0 "$@"