minecraft-launcher/unix/mc_start.sh

53 lines
1.1 KiB
Bash
Raw Normal View History

#!/bin/sh
echo -ne "\033]2;Minecraft Launcher\007"
# 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
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
# *.jar paths generated by make_libs_list.py
LIBRARIES_LIST=
2018-06-12 11:19:38 +03:00
# Player name
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
# 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
# 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 \
-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 {} \
--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