PixelLauncher 2.1.3 — инстансы профилей, старт развёрнутым, аккуратные иконки сборок

This commit is contained in:
kosta2014p committed 2026-10-21 22:58:41 +07:00
1 parent 39cf752b7b
commit a04a586038
13 files changed
+1219 -119

No files matched your search

+8 -6
View File
@@ -32,11 +32,13 @@ def _split_loader(lid):
def read_manifest(path):
"""Читает manifest.json. Возвращает (данные, mc, loader, loader_ver)."""
with zipfile.ZipFile(path) as z:
names = set(z.namelist())
if "manifest.json" not in names:
raise RuntimeError("в архиве нет manifest.json")
with z.open("manifest.json") as f:
data = json.loads(f.read().decode("utf-8"))
return _read_manifest(z)
def _read_manifest(zf):
"""То же, но из уже открытого архива."""
with zf.open("manifest.json") as f:
data = json.loads(f.read().decode("utf-8"))
minecraft = data.get("minecraft") or {}
mc = minecraft.get("version") or ""
loader, loader_ver = "", ""
@@ -123,7 +125,7 @@ def install(game_dir, pack_path, log=None, progress=None, cancel=None):
with zipfile.ZipFile(pack_path) as zf:
names = set(zf.namelist())
if "manifest.json" in names:
data, mc, loader, loader_ver = read_manifest(pack_path)
data, mc, loader, loader_ver = _read_manifest(zf)
mod_list = []
for entry in (data.get("files") or []):
if entry.get("required") is False: