Merge remote-tracking branch 'remotes/dan/forge' into forge-2

This commit is contained in:
Geoff Bourne 2015-03-04 21:35:35 -06:00
commit fab9669b42
2 changed files with 34 additions and 12 deletions

View File

@ -2,6 +2,7 @@ FROM itzg/ubuntu-openjdk-7
MAINTAINER itzg MAINTAINER itzg
RUN apt-get update
RUN apt-get install -y wget libmozjs-24-bin imagemagick && apt-get clean RUN apt-get install -y wget libmozjs-24-bin imagemagick && apt-get clean
RUN update-alternatives --install /usr/bin/js js /usr/bin/js24 100 RUN update-alternatives --install /usr/bin/js js /usr/bin/js24 100
@ -26,4 +27,5 @@ ENV UID 1000
ENV MOTD A Minecraft Server Powered by Docker ENV MOTD A Minecraft Server Powered by Docker
ENV LEVEL world ENV LEVEL world
ENV JVM_OPTS -Xmx1024M -Xms1024M ENV JVM_OPTS -Xmx1024M -Xms1024M
ENV TYPE VANILLA
ENV VERSION LATEST ENV VERSION LATEST

View File

@ -15,22 +15,43 @@ if [ ! -e /data/eula.txt ]; then
fi fi
fi fi
echo "Checking version information."
case $VERSION in case $VERSION in
LATEST) LATEST)
export VERSION=`wget -O - https://s3.amazonaws.com/Minecraft.Download/versions/versions.json | jsawk -n 'out(this.latest.release)'` VANILLA_VERSION=`wget -O - https://s3.amazonaws.com/Minecraft.Download/versions/versions.json | jsawk -n 'out(this.latest.release)'`
FORGE_VERSION=`wget -O - http://files.minecraftforge.net/maven/net/minecraftforge/forge/promotions_slim.json | jsawk -n 'out(this.promos.recommended)'`
;; ;;
SNAPSHOT) SNAPSHOT)
export VERSION=`wget -O - https://s3.amazonaws.com/Minecraft.Download/versions/versions.json | jsawk -n 'out(this.latest.snapshot)'` VANILLA_VERSION=`wget -O - https://s3.amazonaws.com/Minecraft.Download/versions/versions.json | jsawk -n 'out(this.latest.snapshot)'`
FORGE_VERSION=`wget -O - http://files.minecraftforge.net/maven/net/minecraftforge/forge/promotions_slim.json | jsawk -n 'out(this.promos.latest)'`
;; ;;
esac esac
cd /data cd /data
if [ ! -e minecraft_server.$VERSION.jar ]; then echo "Checking minecraft / forge type information."
echo "Downloading minecraft_server.$VERSION.jar ..." case $TYPE in
wget -q https://s3.amazonaws.com/Minecraft.Download/versions/$VERSION/minecraft_server.$VERSION.jar VANILLA)
SERVER="minecraft_server.$VANILLA_VERSION.jar"
if [ ! -e $SERVER ]; then
echo "Downloading $SERVER ..."
wget -q https://s3.amazonaws.com/Minecraft.Download/versions/$VANILLA_VERSION/$SERVER
fi fi
;;
FORGE)
FORGE_INSTALLER="forge-$VANILLA_VERSION-$FORGE_VERSION-installer.jar"
SERVER="forge-$VANILLA_VERSION-$FORGE_VERSION-universal.jar"
if [ ! -e $SERVER ]; then
echo "Downloading $FORGE_INSTALLER ..."
wget -q http://files.minecraftforge.net/maven/net/minecraftforge/forge/$VANILLA_VERSION-$FORGE_VERSION/$FORGE_INSTALLER
echo "Installing $SERVER"
exec java -jar $FORGE_INSTALLER --installServer
fi
;;
esac
if [ ! -e server.properties ]; then if [ ! -e server.properties ]; then
cp /tmp/server.properties . cp /tmp/server.properties .
@ -85,5 +106,4 @@ if [ -n "$ICON" -a ! -e server-icon.png ]; then
fi fi
fi fi
exec java $JVM_OPTS -jar minecraft_server.$VERSION.jar exec java $JVM_OPTS -jar $SERVER