-
Notifications
You must be signed in to change notification settings - Fork 3
/
OmnifactoryMigrate.py
34 lines (25 loc) · 1.68 KB
/
OmnifactoryMigrate.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#Omnifactory Migrate Script
#This script will help move important folders from one instance of the pack to another, saving you time!
#Author: capSAR273, if you have any questions or issues you can contact me on GitHub (Or on the Omnifactory Discord)!
import os
from os import path
import shutil
print("Before you continue, make sure you have imported the new instance in MultiMC from the zip file first!\n")
old_path=os.path.expanduser(input("Enter the path to the old version's minecraft folder.\n"))
new_path=os.path.expanduser(input("Enter the path to the new version's minecraft folder.\n"))
#This will take the important folders/files recommended on the Omnifactory GitHub and copy them to the new instance folder.
def copyFiles(old_path,new_path):
if os.path.exists(os.path.join(new_path,'saves')):
shutil.rmtree(os.path.join(new_path,'saves'))
shutil.copytree(os.path.join(old_path,'saves'), os.path.join(new_path,'saves'))
if os.path.exists(os.path.join(new_path,'resourcepacks')):
shutil.rmtree(os.path.join(new_path,'resourcepacks'))
shutil.copytree(os.path.join(old_path,'resourcepacks'), os.path.join(new_path,'resourcepacks'))
shutil.copyfile(os.path.join(old_path,'options.txt'), os.path.join(new_path,'options.txt'))
if os.path.exists(os.path.join(new_path,'journeymap')):
shutil.rmtree(os.path.join(new_path,'journeymap'))
shutil.copytree(os.path.join(old_path,'journeymap'), os.path.join(new_path,'journeymap'))
shutil.copyfile(os.path.join(old_path,'config','jei','bookmarks.ini'), os.path.join(new_path,'config','jei','bookmarks.ini'))
print("Copying Files...\n")
copyFiles(old_path,new_path)
print("Copy Complete!\n")