Minecraft World Map

Full Version: Script: Make a Large World Smaller for Submission
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Issue: I like to update my map often, but it's a pain in the ass because really only a small part changes, but the entire map itself is about 100mb. Some of my maps in the past have been approaching 1GB. Most of the map is just "exploration", with a small part of the map being where I actually build my creations.

Solution: Create a script that automatically strips out just the files I want and zips them. The script can make a "Limited" RAR with the small part I'm developing, and a full RAR with the entire map, and export them to a convenient place.

Benefits:
  • Automates the RARing\ZIPing of worlds
  • Makes uploads smaller
  • Makes rendering faster
  • Makes your map cleaner, and focus on your creations, not explored territory

Example Limited World Created by Script: http://beta.minecraftworldmap.com/worlds...197/-4/0/0
Example World Before Script: http://beta.minecraftworldmap.com/worlds...197/-4/0/0


Prerequisites\Assumptions:
  • You are using Windows
  • You have WinRAR Installed
  • You have minor scripting knowledge and are comfortable changing a few minor variables at the top of the script

Script Code Wrote:REM Make a large Minecraft world much smaller, and RAR it up for submitting to MineCraftWorldMap.com
REM Will output a limited size RAR, and a full size RAR

REM WORLD is a variable to the folder where your Minecraft world is
set WORLD=%USERPROFILE%\AppData\Roaming\.Minecraft\Saves\World1

REM ERROR CHECKING - If World does not exist, exit.
IF NOT EXIST %WORLD% exit

REM ScriptWorkingDirectory is a working directory where the limited copy of your world will be created, you can change this with little consequence
set ScriptWorkingDirectory=C:\MCLimitingScriptTempDir

REM WINRAR is a variable that points to where you WINRAR.exe file is.
if exist "%PROGRAMFILES(x86)%\WinRAR\WinRAR.exe" set WINRAR="%PROGRAMFILES%(x86)\WinRAR\WinRAR.exe"
if exist "%PROGRAMFILES%\WinRAR\WinRAR.exe" set WINRAR="%PROGRAMFILES%\WinRAR\WinRAR.exe"

REM ERROR CHECKING - If WINRAR is not installed, exit.
if not exist "%PROGRAMFILES(x86)%\WinRAR\WinRAR.exe" if not exist "%PROGRAMFILES%\WinRAR\WinRAR.exe" exit

REM RAROUTPUT is a variable where the .RAR files will be outputted. By default, it's your desktop.
set RAROUTPUT=%USERPROFILE%\Desktop

REM ERROR CHECKING - If RAROUTPUT does not exist, exit
IF NOT EXIST %RAROUTPUT% exit

REM Delete Previous Outputted RARs
if exist %RAROUTPUT%\LimitedWorld.rar del %RAROUTPUT%\LimitedWorld.rar /f /q
if exist %RAROUTPUT%\FullWorld.rar del %RAROUTPUT%\FullWorld.rar /f /q

REM Delete the ScriptWorkingDirectory
IF EXIST %ScriptWorkingDirectory% RD %ScriptWorkingDirectory% /S /Q

REM Create Temp Dir if it doesn't exist
IF NOT EXIST %ScriptWorkingDirectory% md %ScriptWorkingDirectory%

REM Copy Miscellaneous Files
xcopy "%WORLD%\data" "%ScriptWorkingDirectory%\data\" /E
xcopy "%WORLD%\playerdata" "%ScriptWorkingDirectory%\playerdata\" /E
xcopy "%WORLD%\stats" "%ScriptWorkingDirectory%\stats\" /E
xcopy "%WORLD%\level.dat" "%ScriptWorkingDirectory%\"
xcopy "%WORLD%\level.dat_mcr" "%ScriptWorkingDirectory%\"
xcopy "%WORLD%\level.dat_old" "%ScriptWorkingDirectory%\"
xcopy "%WORLD%\session.lock" "%ScriptWorkingDirectory%\"

REM You'll need to copy each MCA file that contains areas you're interested in. This may take some trial and error to nail down.
REM I've included the 9 MCA's closest to 0,0, but I've REMed most of them out

REM xcopy "%WORLD%\Region\r.-1.-1.mca" "%ScriptWorkingDirectory%\region\"
xcopy "%WORLD%\Region\r.-1.0.mca" "%ScriptWorkingDirectory%\region\"
REM xcopy "%WORLD%\Region\r.-1.1.mca" "%ScriptWorkingDirectory%\region\"
REM xcopy "%WORLD%\Region\r.0.-1.mca" "%ScriptWorkingDirectory%\region\"
xcopy "%WORLD%\Region\r.0.0.mca" "%ScriptWorkingDirectory%\region\"
REM xcopy "%WORLD%\Region\r.0.1.mca" "%ScriptWorkingDirectory%\region\"
REM xcopy "%WORLD%\Region\r.1.-1.mca" "%ScriptWorkingDirectory%\region\"
REM xcopy "%WORLD%\Region\r.1.0.mca" "%ScriptWorkingDirectory%\region\"
REM xcopy "%WORLD%\Region\r.1.1.mca" "%ScriptWorkingDirectory%\region\"

REM Output Limited RAR
%WINRAR% a -r -ep1 "%RAROUTPUT%\LimitedWorld.rar" "%ScriptWorkingDirectory%\*.*"

REM Output Full Map RAR. You can delete this line if you're not interested in a full map RAR
%WINRAR% a -r -ep1 "%RAROUTPUT%\FullWorld.rar" "%WORLD%\*.*"