-
Notifications
You must be signed in to change notification settings - Fork 0
/
main_mohistmc.py
86 lines (78 loc) · 1.62 KB
/
main_mohistmc.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
import asyncio
from src.handler import mohistmc_runner
from src.utils import SyncLogger, init_settings, read_settings, argument_parser
from src import __version__
from src.api import start_production_server
import sys
available_core = """
ArclightPowered
├─Arclight
├─Lightfall
└─Lightfall Client
MohistMC
├─Banner
└─Mohist
SpigotMC
├─Spigot
└─BungeeCord
LeavesMC
└─Leaves
Pufferfish
├─Pufferfish
├─Pufferfish+
└─Pufferfish+ (Purpur)
SpongePowered
├─SpongeForge
└─SpongeVanilla
PaperMC
├─Paper
├─Folia
├─Travertine
├─Velocity
└─Waterfall
PurpurMC
├─Purpur
└─Purformance
LuminolMC
├─Luminol
└─LightingLuminol
GeyserMC
├─Geyser
└─Floodgate
NukkitX
Thermos
Contigo
Akarin
CatServer
Craftbukkit
Vanilla
Fabric
Forge"""
async def update_default():
tasks = [
asyncio.create_task(mohistmc_runner()),
]
for task in tasks:
await task
if __name__ == "__main__":
args = argument_parser.parse_args()
if not any(value for _, value in args.__dict__.items()):
argument_parser.error("No argument was specified.")
if args.init:
init_settings()
if args.server:
read_settings()
start_production_server()
if args.version:
print(__version__)
if args.core_list:
SyncLogger.success(available_core)
if args.update:
asyncio.run(update_default())
if args.optimize:
from src.utils import optimize_core_data
asyncio.run(optimize_core_data())
if args.add_node:
from src.utils import add_node
add_node(args.add_node)
sys.exit(0)