-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
35 lines (33 loc) · 1.13 KB
/
main.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
import minecraft_launcher_lib
import subprocess
import os
import json
import shutil
from colorama import *
import easygui_qt
import version_detect
import requests
print(Fore.WHITE + Back.BLACK + "Welcome in MapMC!")
input_folder = easygui_qt.easygui_qt.get_directory_name(title='Select the MapMC input folder')
if input_folder == '':
easygui_qt.easygui_qt.get_abort(message='You must select a folder!', title='MapMC')
os.chdir(input_folder)
directory = os.getcwd()
os.chdir('advancements')
mc_version = version_detect.version()
easygui_qt.easygui_qt.show_message(message="Map is moved to Minecraft!", title='MapMC')
try:
os.chdir(directory)
original = os.getcwd()
target = minecraft_launcher_lib.utils.get_minecraft_directory() + "\saves"
shutil.move(original, target)
except PermissionError:
pass
name = "Notch"
options = {
"username": name,
}
mc_directory = minecraft_launcher_lib.utils.get_minecraft_directory()
minecraft_command = minecraft_launcher_lib.command.get_minecraft_command(mc_version, mc_directory, options)
minecraft_launcher_lib.fabric.install_fabric(mc_version, mc_directory)
subprocess.call(minecraft_command)