Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --- minecraft_server.sh Wed Dec 12 09:01:03 2012
- +++ /minecraft_server.sh Wed Dec 12 14:14:02 2012
- @@ -40,6 +40,7 @@
- #
- # Available software packages for update option:
- # server - Minecraft server software.
- +# client - Minecraft client software, for mapping.
- # User name used to run all commands.
- @@ -70,7 +71,8 @@
- # Software packages updated with the update command.
- # server - Minecraft server software.
- -UPDATE_PACKAGES="server"
- +# client - Minecraft client software, for mapping.
- +UPDATE_PACKAGES="server client"
- ## Minecraft server options.
- @@ -625,6 +627,25 @@
- fi
- }
- +# update the Minecraft client.
- +updateClientSoftware() {
- + # Backup the old client jar.
- + if [ -e $CLIENT_JAR ]; then
- + execute "mv -f \"$CLIENT_JAR\" \"$CLIENT_JAR.old\"" $USER_NAME
- + fi
- +
- + # Download the client software
- + execute "$WGET -qO \"$CLIENT_JAR\" \"$CLIENT_URL\"" $USER_NAME
- +
- + # Check for error and restore backup if found.
- + if [ $? -ne 0 ]; then
- + printf "\nError downloading the Minecraft client.\n"
- + if [ -e "$CLIENT_JAR.old" ]; then
- + execute "mv -f \"$CLIENT_JAR.old\" \"$CLIENT_JAR\"" $USER_NAME
- + fi
- + fi
- +}
- +
- # Update the server software.
- updateServerSoftware() {
- execute "mkdir -p $SERVER_LOCATION" $USER_NAME
- @@ -653,6 +674,9 @@
- server)
- updateServerSoftware
- ;;
- + client)
- + updateClientSoftware
- + ;;
- *)
- printf "Unknown software package: $1\n"
- exit 1
- @@ -669,15 +693,17 @@
- execute "mkdir -p $MAPS_LOCATION/$1" $USER_NAME
- # Make sure the Minecraft client is available.
- if [ ! -e $CLIENT_JAR ]; then
- - echo "Downloading the Minecraft client for texture files..."
- - execute "$WGET -qO \"$CLIENT_JAR\" \"$CLIENT_URL\"" $USER_NAME
- - if [ $? -ne 0 ]; then
- - printf "\nError downloading the Minecraft client.\n"
- - exit 1
- - fi
- + updateClientSoftware
- fi
- # Make sure that the world files are actually there before mapping.
- if [ -e "$WORLDS_LOCATION/$1/server.properties" ]; then
- + # Check for MC-Overviewer overviewer-settings.py file
- + if [ -e "$WORLDS_LOCATION/$1/overviewer-settings.py" ]; then
- + # Generate Map
- + execute "$OVERVIEWER_BIN --config=$WORLDS_LOCATION/$1/overviewer-settings.py" $USER_NAME
- + # Generate POI (Signs)
- + execute "$OVERVIEWER_BIN --config=$WORLDS_LOCATION/$1/overviewer-settings.py --genpoi" $USER_NAME
- + fi
- execute "$OVERVIEWER_BIN --rendermodes=normal,lighting,cave --processes 1 $WORLDS_LOCATION/$1/$1 $MAPS_LOCATION/$1" $USER_NAME > /dev/null 2>&1
- fi
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement