* fixes in launcher

launcher
Dominika Liberda 2022-05-23 20:03:34 +02:00
parent 4543bd18dc
commit a493fa57d8
2 changed files with 24 additions and 10 deletions

View File

@ -4,12 +4,25 @@ function launch() {
cd "$1"
mkdir -p natives
for i in $(find libraries/ | grep natives); do
cp "$i" natives/
done
for i in natives/*.jar; do
7z x -onatives/ $i -y
done
if [[ "$2" == '' ]]; then # for testing
for i in $(find libraries/ | grep natives); do
cp "$i" natives/
done
for i in natives/*.jar; do
7z x -onatives/ $i -y
done
fi
java -Djava.library.path=natives/ -cp $(find libraries/ -type f | tr '\n' ':'):client.jar $(jq -r '.mainClass' < manifest.json)
/usr/lib/jvm/java-8-openjdk/bin/java \
-Xms128M \
-Xmx1G \
-Djava.library.path=natives/ \
-cp $(find libraries/ -type f | tr '\n' ':'):client.jar \
$(jq -r '.mainClass' < manifest.json) \
--gameDir "$(realpath .)" \
--assetsDir "$(realpath .)/assets" \
--version $1 \
--accessToken "$(jq -r '.accessToken' < ../auth.json)" \
--username "$(jq -r '.selectedProfile.name' < ../auth.json)" \
--uuid "$(jq -r '.selectedProfile.id' < ../auth.json)"
}

View File

@ -21,8 +21,11 @@ function fetch_version() {
return 1
fi
mkdir -p meow; cd meow
mkdir -p $1; cd $1
curl -o manifest.json "$url"
curl -o client.jar "$(jq -r '.downloads.client.url' < manifest.json)"
curl -o assets.json "$(jq -r '.assetIndex.url' < manifest.json)"
mew="$(jq -r '.libraries[].downloads | if .classifiers then select(.classifiers["natives-linux"]) | .classifiers["natives-linux"] else .artifact end | "\(.url) \(.path)"' < manifest.json)"
@ -35,8 +38,6 @@ function fetch_version() {
curl -o "$path" "$_url"
done
cd ..
curl -o client.jar "$(jq -r '.downloads.client.url' < manifest.json)"
curl -o assets.json "$(jq -r '.assetIndex.url' < manifest.json)"
# assets
mkdir -p assets; cd assets