SHARE
TWEET

minecraft_server overviewer config patch

a guest Dec 12th, 2012 47 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. --- minecraft_server.sh Wed Dec 12 09:01:03 2012
  2. +++ /minecraft_server.sh        Wed Dec 12 14:14:02 2012
  3. @@ -40,6 +40,7 @@
  4.  #
  5.  #   Available software packages for update option:
  6.  #     server        - Minecraft server software.
  7. +#     client        - Minecraft client software, for mapping.
  8.  
  9.  
  10.  # User name used to run all commands.
  11. @@ -70,7 +71,8 @@
  12.  
  13.  # Software packages updated with the update command.
  14.  #   server        - Minecraft server software.
  15. -UPDATE_PACKAGES="server"
  16. +#   client        - Minecraft client software, for mapping.
  17. +UPDATE_PACKAGES="server client"
  18.  
  19.  
  20.  ## Minecraft server options.
  21. @@ -625,6 +627,25 @@
  22.         fi
  23.  }
  24.  
  25. +# update the Minecraft client.
  26. +updateClientSoftware() {
  27. +       # Backup the old client jar.
  28. +       if [ -e $CLIENT_JAR ]; then
  29. +               execute "mv -f \"$CLIENT_JAR\" \"$CLIENT_JAR.old\"" $USER_NAME
  30. +       fi
  31. +
  32. +       # Download the client software
  33. +       execute "$WGET -qO \"$CLIENT_JAR\" \"$CLIENT_URL\"" $USER_NAME
  34. +
  35. +       # Check for error and restore backup if found.
  36. +       if [ $? -ne 0 ]; then
  37. +               printf "\nError downloading the Minecraft client.\n"
  38. +               if [ -e "$CLIENT_JAR.old" ]; then
  39. +                       execute "mv -f \"$CLIENT_JAR.old\" \"$CLIENT_JAR\"" $USER_NAME
  40. +               fi
  41. +       fi
  42. +}
  43. +
  44.  # Update the server software.
  45.  updateServerSoftware() {
  46.         execute "mkdir -p $SERVER_LOCATION" $USER_NAME
  47. @@ -653,6 +674,9 @@
  48.                 server)
  49.                         updateServerSoftware
  50.                 ;;
  51. +               client)
  52. +                       updateClientSoftware
  53. +               ;;
  54.                 *)
  55.                         printf "Unknown software package: $1\n"
  56.                         exit 1
  57. @@ -669,15 +693,17 @@
  58.         execute "mkdir -p $MAPS_LOCATION/$1" $USER_NAME
  59.         # Make sure the Minecraft client is available.
  60.         if [ ! -e $CLIENT_JAR ]; then
  61. -               echo "Downloading the Minecraft client for texture files..."
  62. -               execute "$WGET -qO \"$CLIENT_JAR\" \"$CLIENT_URL\"" $USER_NAME
  63. -               if [ $? -ne 0 ]; then
  64. -                       printf "\nError downloading the Minecraft client.\n"
  65. -                       exit 1
  66. -               fi
  67. +               updateClientSoftware
  68.         fi
  69.         # Make sure that the world files are actually there before mapping.
  70.         if [ -e "$WORLDS_LOCATION/$1/server.properties" ]; then
  71. +               # Check for MC-Overviewer overviewer-settings.py file
  72. +               if [ -e "$WORLDS_LOCATION/$1/overviewer-settings.py" ]; then
  73. +                       # Generate Map
  74. +                       execute "$OVERVIEWER_BIN --config=$WORLDS_LOCATION/$1/overviewer-settings.py" $USER_NAME
  75. +                       # Generate POI (Signs)
  76. +                       execute "$OVERVIEWER_BIN --config=$WORLDS_LOCATION/$1/overviewer-settings.py --genpoi" $USER_NAME
  77. +               fi
  78.                 execute "$OVERVIEWER_BIN --rendermodes=normal,lighting,cave --processes 1 $WORLDS_LOCATION/$1/$1 $MAPS_LOCATION/$1" $USER_NAME > /dev/null 2>&1
  79.         fi
  80.  }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top