Skip to content

Instantly share code, notes, and snippets.

@tildejustin
Last active August 25, 2024 02:59
Show Gist options
  • Save tildejustin/ae9e17fe361fc08e8545691b0fba52af to your computer and use it in GitHub Desktop.
Save tildejustin/ae9e17fe361fc08e8545691b0fba52af to your computer and use it in GitHub Desktop.
Worldbopper but it doesn't make a log file every time
# originally by Specnr
# edited to use terminal output
# parallelization stolen from jojoe
import glob
from concurrent import futures
import os
import shutil
INST_FOLDER = r"C:\Users\justi\AppData\Roaming\PrismLauncher\instances"
RECORDS_FOLDER = r"C:\Users\justi\speedrunigt\records"
print("Deleting worlds...")
with futures.ThreadPoolExecutor() as executor:
files = glob.glob(f'{INST_FOLDER}/*/.minecraft/saves/*')
for f in files:
if os.path.isdir(f) and ("New World" in f or "New Wurld" in f or "ma sin" in f or "Speedrun #" in f or "Practice Seed" in f or " attempt " in f or "mcsrranked " in f or "Benchmark Reset #" in f or "shareware" in f or "Demo_World" in f):
print("deleting " + f)
executor.submit(shutil.rmtree, f)
else:
print("skipping " + f)
print("deleting records")
files = glob.glob(f'{RECORDS_FOLDER}/*.json')
for f in files:
executor.submit(os.remove, f)
input("bopping completed, press enter to exit...")
executor.shutdown()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment