-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlauncher
executable file
·56 lines (49 loc) · 1.5 KB
/
launcher
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/bin/sh
# Example launcher
set -ex
VERSION=$1
if test -z "$VERSION"; then
echo "Usage: launcher <version>"
exit 64
fi
# Implement your Yggdrasil client here.
export auth_player_name=Steve
export auth_uuid=12345
export auth_access_token=12345
export JVM_ARGS="-Xmx8192m -Duser.home=null"
export version_name=xxx
export game_directory=~/Minecraft/$VERSION/
export launcher_name=Shell
export launcher_version=Alex
export user_type=mojang
export version_type=release
export assets_root=$game_directory/assets/
source /usr/share/java/minecraft/$VERSION/launcher.gen
if test -e /usr/share/java/minecraft/$VERSION/launcher.fabric.gen; then
source /usr/share/java/minecraft/$VERSION/launcher.fabric.gen
fi
# For old versions
# https://stackoverflow.com/a/8811800
contains() {
string="$1"
substring="$2"
if test "${string#*$substring}" != "$string"
then
return 0
else
return 1
fi
}
contains "$JVM_ARGS" "-cp" || JVM_ARGS="$JVM_ARGS -cp ${classpath}"
contains "$JVM_ARGS" "-Djava.library.path=" || JVM_ARGS="$JVM_ARGS -Djava.library.path=${natives_directory}"
mkdir -p $assets_root
mkdir -p $assets_root/skin
ln -s /usr/share/minecraft/assets/$assets_index_name/objects $assets_root/objects || true
ln -s /usr/share/minecraft/assets/$assets_index_name/indexes $assets_root/indexes || true
cd $game_directory
# For 1.12 and below, use this line instead:
# exec /usr/lib/jvm/java-8-openjdk/jre/bin/java \
exec /usr/lib/jvm/java-17-openjdk/bin/java \
$JVM_ARGS \
$MAIN_CLASS \
$MC_ARGS