forked from capSAR273/omnifactory-migrator
-
Notifications
You must be signed in to change notification settings - Fork 1
/
NomifactoryMigrator.py
39 lines (29 loc) · 1.97 KB
/
NomifactoryMigrator.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
35
36
37
38
39
#!/usr/bin/env python3
#Nomifactory or Nomifactory CEu Migrate Script
#This script will help move important folders from one instance of the pack to another, saving you time!
#Original Author: capSAR273, updated author, IntegerLimit, if you have any questions or issues you can contact me on GitHub (Or on the Nomifactory Discord)!
import os
from os import path
import shutil
print("Before you continue, make sure you have imported the new instance in your preffered launcher from CurseForge, or a 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 Nomifactory 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'))
if os.path.exists(os.path.join(new_path,'visualores')):
shutil.rmtree(os.path.join(new_path,'visualores'))
shutil.copytree(os.path.join(old_path,'visualores'), os.path.join(new_path,'visualores'))
shutil.copyfile(os.path.join(old_path,'hei_bookmarks.ini'), os.path.join(new_path,'hei_bookmarks.ini'))
print("Copying Files...\n")
copyFiles(old_path,new_path)
print("Copy Complete!\n")