Advertisement
Guest User

delete_unused_chunks.bat

a guest
Jun 17th, 2024
209
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 1.10 KB | Gaming | 0 0
  1. @echo off
  2. REM Enable delayed expansion
  3. setlocal enabledelayedexpansion
  4.  
  5. if "%~1"=="" (
  6.     echo No directory path provided.
  7.     exit /b 1
  8. )
  9. set "dirPath=%~1"
  10. set query="InhabitedTime < \"5 minutes\""
  11.  
  12. echo Running query on path %dirPath% ...
  13. mcaselector.jar --mode delete --world "%dirPath%" --query %query%
  14.  
  15. echo Running query for Nether ...
  16. mcaselector.jar --mode delete --world "%dirPath%\DIM-1" --query %query%
  17.  
  18. echo Running query for End ...
  19. mcaselector.jar --mode delete --world "%dirPath%\DIM1" --query %query%
  20.  
  21.  
  22. REM Check if the dimensions directory exists
  23. if not exist "%dirPath%\dimensions" (
  24.     echo The dimensions directory does not exist.
  25.     exit /b 1
  26. )
  27.  
  28. REM Loop through each subdirectory in the dimensions directory
  29. for /d %%d in ("%dirPath%\dimensions\*") do (
  30.    REM Loop through each subdirectory within %%d
  31.     for /d %%x in ("%%d\*") do (
  32.        REM Check if the region subdirectory exists within %%x
  33.         if exist "%%x\region" (
  34.             echo Running query for %%x ...
  35.  
  36.             mcaselector.jar --mode delete --world "%%x" --query %query%
  37.         )
  38.     )
  39. )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement