Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Script: Make a Large World Smaller for Submission
12-29-2014, 12:57 PM, (This post was last modified: 12-29-2014, 01:18 PM by sstruzik.)
Posts: 44
Threads: 13
Joined: Apr 2012
Reputation: 2
Script: Make a Large World Smaller for Submission
sstruzik Offline Premium View worlds
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.

  • 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:
Example World Before Script:

  • 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
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.

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"

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.

REM ERROR CHECKING - If RAROUTPUT does not exist, 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%\*.*"

Forum Jump:

Users browsing this thread: 1 Guest(s)