Skip to content

Commit

Permalink
good
Browse files Browse the repository at this point in the history
  • Loading branch information
lilingfengdev committed Jun 8, 2024
1 parent f7a5077 commit 5cb2b9d
Showing 1 changed file with 21 additions and 4 deletions.
25 changes: 21 additions & 4 deletions select-server.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,19 @@ def get_url_by_version(self, ver):
return f"https://ci.codemc.io/job/MohistMC/job/Mohist-{ver}/lastCompletedBuild/artifact/{path}"


class CardBoard(SelectNode):
def __init__(self):
super().__init__("Fabric混合", {})

def get_version_list(self):
vers = json.loads(requests.get("https://api.modrinth.com/v2/project/cardboard/version").content)
for ver in vers:
for game in ver["game_versions"]:
if game not in self.map.keys():
self.map[game] = ver["files"][0]["url"]
return list(self.map.keys())


root = SelectTree("")

# 插件
Expand Down Expand Up @@ -135,11 +148,11 @@ def get_url_by_version(self, ver):

forge.children = [forge1710, forge1122, Mohist()]

fabric = SelectTree("Fabric混合")
mix.children = [forge, CardBoard()]

mix.children = [forge, fabric]
mod = SelectTree("mod服(不要选择,目前不支持自动下载)")

root.children = [plugin, mix]
root.children = [plugin, mix, mod]

while True:
if isinstance(root, SelectTree):
Expand All @@ -158,4 +171,8 @@ def get_url_by_version(self, ver):
i = input("\033[33m你的选择:\033[0m")
url = root.get_url_by_version(i)
break
print(url)
print(f"下载链接:{url}")
if ask("自动下载?"):
download(url, "server.jar")
print("下载完成")
exit_()

0 comments on commit 5cb2b9d

Please sign in to comment.