|
|
|
@ -1,26 +1,32 @@
|
|
|
|
|
#!/bin/sh
|
|
|
|
|
echo -ne "\033]2;Minecraft Launcher\007"
|
|
|
|
|
|
|
|
|
|
# Git repo: https://git.a2s.su/iiiypuk/minecraft-launcher
|
|
|
|
|
|
|
|
|
|
# include colors library
|
|
|
|
|
source ./colors.sh
|
|
|
|
|
|
|
|
|
|
# Setting terminal emulator title
|
|
|
|
|
echo -ne "\033]30;Minecraft Launcher\007"
|
|
|
|
|
clear
|
|
|
|
|
|
|
|
|
|
# Launcher title
|
|
|
|
|
echo "Minecraft Launcher by iiiypuk"
|
|
|
|
|
echo "============================="
|
|
|
|
|
echo -e "${BRIGHT_GREEN_B}Minecraft Launcher by ${BRIGHT_RED_B}iiiypuk${NC}"
|
|
|
|
|
echo -e "${BRIGHT_YELLOW_B}=============================${NC}"
|
|
|
|
|
|
|
|
|
|
# Set username
|
|
|
|
|
read -p "What username would you like? " player
|
|
|
|
|
read -p "$(echo -e ${BRIGHT_CYAN_B}What username would you like?${NC}) " player
|
|
|
|
|
if [ ! $player ]; then
|
|
|
|
|
player="Steve"
|
|
|
|
|
fi
|
|
|
|
|
echo ''
|
|
|
|
|
|
|
|
|
|
# A minecraft root directory
|
|
|
|
|
MC_DIR=$HOME/.minecraft
|
|
|
|
|
|
|
|
|
|
# Get archive from natives/ dir
|
|
|
|
|
NATIVES_DIR=$MC_DIR/bin/1.20.2
|
|
|
|
|
|
|
|
|
|
# Are stored here...
|
|
|
|
|
# saves/, resourcepacks/ and screenshots/ dirs
|
|
|
|
|
# and options.txt and servers.dat files
|
|
|
|
|
GAME_DIR=$MC_DIR
|
|
|
|
|
GAME_DIR=$MC_DIR/userdata
|
|
|
|
|
|
|
|
|
|
# Libraries and resource dir (requires no changes)
|
|
|
|
|
ASSETS_DIR=$MC_DIR/assets
|
|
|
|
@ -29,6 +35,9 @@ ASSETS_INDEX=5
|
|
|
|
|
# Version minecraft (from versions/ dir)
|
|
|
|
|
GAME_VERSION=1.20.4
|
|
|
|
|
|
|
|
|
|
# Get archive from natives/ dir
|
|
|
|
|
NATIVES_DIR=$MC_DIR/bin/$GAME_VERSION
|
|
|
|
|
|
|
|
|
|
# *.jar paths from version.json
|
|
|
|
|
LIBRARIES_LIST="\
|
|
|
|
|
$MC_DIR/libraries/com/github/oshi/oshi-core/6.4.5/oshi-core-6.4.5.jar:\
|
|
|
|
@ -108,9 +117,13 @@ WINDOW_H=640
|
|
|
|
|
JVM_RAM="-Xmx2G"
|
|
|
|
|
JVM_ARGS="-XX:+UnlockExperimentalVMOptions -XX:+UseG1GC -XX:G1NewSizePercent=20 -XX:G1ReservePercent=20 -XX:MaxGCPauseMillis=50 -XX:G1HeapRegionSize=32M"
|
|
|
|
|
|
|
|
|
|
# Running minecraft
|
|
|
|
|
# Change directory
|
|
|
|
|
cd $MC_DIR
|
|
|
|
|
|
|
|
|
|
# Prepare game directory
|
|
|
|
|
mkdir -p $MC_DIR/userdata
|
|
|
|
|
|
|
|
|
|
# Running minecraft
|
|
|
|
|
$MC_DIR/runtime/java-runtime-gamma/linux/java-runtime-gamma/bin/java \
|
|
|
|
|
$JVM_RAM $JVM_ARGS \
|
|
|
|
|
-cp $LIBRARIES_LIST \
|
|
|
|
|