2021-02-10 22:37:47 +03:00
|
|
|
#!/bin/sh
|
2020-05-07 21:57:15 +03:00
|
|
|
echo -ne "\033]2;Minecraft Launcher\007"
|
|
|
|
|
2021-02-10 22:37:47 +03:00
|
|
|
# Set username
|
|
|
|
read -p "What username would you like?: " player
|
|
|
|
|
2018-06-12 11:19:38 +03:00
|
|
|
# A minecraft root directory
|
|
|
|
MC_DIR=~/.minecraft
|
|
|
|
|
2020-05-08 19:26:57 +03:00
|
|
|
# Are stored here...
|
|
|
|
# saves/, resourcepacks/ and screenshots/ dirs
|
|
|
|
# and options.txt and servers.dat files
|
2020-10-15 00:17:18 +03:00
|
|
|
GAME_DIR=$MC_DIR
|
2020-05-08 19:26:57 +03:00
|
|
|
|
2018-06-12 11:19:38 +03:00
|
|
|
# Assets location
|
|
|
|
ASSETS_DIR=$MC_DIR/assets
|
2021-07-21 04:39:18 +03:00
|
|
|
ASSETS_INDEX=1.17
|
2018-06-12 11:19:38 +03:00
|
|
|
|
|
|
|
# Version to use
|
2021-07-21 04:39:18 +03:00
|
|
|
GAME_VERSION=1.17.1
|
2018-06-12 11:19:38 +03:00
|
|
|
|
|
|
|
# Native libs location
|
2020-05-07 21:43:02 +03:00
|
|
|
NATIVES_DIR=$MC_DIR/bin/$GAME_VERSION
|
2018-06-12 11:19:38 +03:00
|
|
|
|
2021-02-10 22:48:03 +03:00
|
|
|
# *.jar paths generated by make_libs_list.py
|
|
|
|
LIBRARIES_LIST=
|
|
|
|
|
2018-06-12 11:19:38 +03:00
|
|
|
# Player name
|
2021-02-10 22:37:47 +03:00
|
|
|
PLAYER_NAME=$player
|
2018-06-12 11:19:38 +03:00
|
|
|
|
2020-05-07 21:43:02 +03:00
|
|
|
# Game window resolution
|
|
|
|
WINDOW_W=800
|
|
|
|
WINDOW_H=640
|
|
|
|
|
2021-02-10 22:48:03 +03:00
|
|
|
# Java machine arguments
|
2020-05-08 19:01:57 +03:00
|
|
|
JVM_RAM="-Xmx2G"
|
|
|
|
JVM_ARGS="-XX:+UnlockExperimentalVMOptions -XX:+UseG1GC -XX:G1NewSizePercent=20 -XX:G1ReservePercent=20 -XX:MaxGCPauseMillis=50 -XX:G1HeapRegionSize=32M"
|
2018-06-12 11:19:38 +03:00
|
|
|
|
2021-02-10 22:48:03 +03:00
|
|
|
# Running minecraft
|
2018-06-12 11:19:38 +03:00
|
|
|
cd $MC_DIR
|
|
|
|
|
2020-05-08 19:01:57 +03:00
|
|
|
java $JVM_RAM $JVM_ARGS \
|
2020-05-06 20:28:05 +03:00
|
|
|
-Djava.library.path=$NATIVES_DIR \
|
2021-02-10 22:48:03 +03:00
|
|
|
-cp $LIBRARIES_LIST \
|
2020-05-08 19:01:57 +03:00
|
|
|
net.minecraft.client.main.Main \
|
2020-05-07 21:43:02 +03:00
|
|
|
--username $PLAYER_NAME \
|
|
|
|
--version $GAME_VERSION \
|
2020-05-06 20:28:05 +03:00
|
|
|
--accessToken 0 --userProperties {} \
|
2020-10-15 00:17:18 +03:00
|
|
|
--gameDir $GAME_DIR \
|
2020-05-06 20:28:05 +03:00
|
|
|
--assetsDir $ASSETS_DIR \
|
|
|
|
--assetIndex $ASSETS_INDEX \
|
2020-05-07 21:43:02 +03:00
|
|
|
--width $WINDOW_W --height $WINDOW_H
|