Created
January 3, 2012 00:43
-
-
Save auscompgeek/1552867 to your computer and use it in GitHub Desktop.
VERY simple Bash launcher for Minecraft client
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# MIIIINECRAFT!!! (No authentication :p) | |
# Configuration section: | |
mc_dl_path="https://s3.amazonaws.com/MinecraftDownload/" #where all minecraft downloads are | |
lwjgl_version="2.8.1" #which version of LWJGL you wish to update to by default | |
cmd_get="wget" #what command you use to GET files | |
HOME="." #path where you want .minecraft | |
cd | |
# Ensure we have a .minecraft AND .minecraft/bin AND .minecraft/bin/natives folder | |
[ ! -d .minecraft/bin/natives ] && mkdir -p .minecraft/bin/natives | |
# Update LWJGL code. (WIP) | |
update_lwjgl() { | |
[ "$1" ] && lwjgl_version="$1" | |
cd .minecraft/bin | |
if [ "$lwjgl_version" = "mc" ] | |
then #download the vanilla Minecraft version | |
eval $cmd_get "${mc_dl_path}jinput.jar" "${mc_dl_path}lwjgl.jar" "${mc_dl_path}lwjgl_util.jar" "${mc_dl_path}linux_natives.jar.lzma" "${mc_dl_path}macosx_natives.jar.lzma" "${mc_dl_path}windows_natives.jar.lzma" | |
cd natives | |
xz ../*.lzma | |
unzip *.jar | |
return | |
fi | |
eval $cmd_get -O lwjgl.zip "http://downloads.sourceforge.net/project/java-game-lib/Official%20Releases/LWJGL%20${lwjgl_version}/lwjgl-${lwjgl_version}.zip" | |
# need to extract relevant files into relevant directories | |
unzip "lwjgl-${lwjgl_version}.zip" | |
} | |
# Update everything! | |
if [ "$1" = "update" ] | |
then | |
cd .minecraft/bin | |
eval $cmd_get "${mc_dl_path}minecraft.jar" | |
update_lwjgl "$2" | |
exit | |
fi | |
# Update Minecraft only. | |
if [ "$1" = "update-mc" ] | |
then | |
cd .minecraft/bin | |
eval $cmd_get "${mc_dl_path}minecraft.jar" | |
exit | |
fi | |
# Update LWJGL only. | |
if [ "$1" = "update-lwjgl" ] | |
then | |
update_lwjgl "$2" | |
exit | |
fi | |
echo -n 'Username: ' | |
read mcname | |
stty -echo | |
echo -n 'Password: ' | |
read mcpass | |
stty echo | |
java -Xms512m -Xmx1024m -cp ".minecraft/bin/*" -Djava.library.path='.minecraft/bin/natives' net.minecraft.client.Minecraft "$mcname" "$mcpass" |
ilfilk
u
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
hello