diff --git a/ReadMe.md b/ReadMe.md index bc292d9..1bb46ff 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -57,10 +57,18 @@ I'd be happy. Just make a PR and ensure, it is working for most versions (And pl - Models - Statistics - General version information - - Version name - - Protocol version - - Data version + - Version name + - Protocol version + - Data version - Block entities - Sounds - - Categories - - Sounds + - Categories + - Sounds + +## Dependencies + +- Maven +- [MC-Remapper](https://github.com/HeartPattern/MC-Remapper) +- [objenesis](https://github.com/easymock/objenesis) +- Kotlin +- [ujson](https://pypi.org/project/ujson/) diff --git a/wrapper/PixLyzer.py b/wrapper/PixLyzer.py index 8584152..41c4c61 100755 --- a/wrapper/PixLyzer.py +++ b/wrapper/PixLyzer.py @@ -20,6 +20,8 @@ ADDITIONAL_CLASSPATH = "/home/moritz/kotlin-stdlib-1.4.30.jar:/home/moritz/Games VERSION_MANIFEST_URL = "https://launchermeta.mojang.com/mc/game/version_manifest.json" +COMPILE_VERSION = "21w08a" + failedVersionIds = [] partlyFailedVersionIds = [] @@ -30,9 +32,9 @@ VERSION_MANIFEST = ujson.loads(urllib.request.urlopen(VERSION_MANIFEST_URL).read def searchVersion(versionId): global VERSION_MANIFEST - for version in VERSION_MANIFEST["versions"]: - if version["id"] == versionId: - return version + for versionEntry in VERSION_MANIFEST["versions"]: + if versionEntry["id"] == versionId: + return versionEntry raise Exception("Unknown version: %s" % versionId) @@ -52,15 +54,16 @@ def runAndWait(command): return exitCode -def getVersionJson(version): +def getVersionJson(versionEntry): # check cache global DATA_FOLDER - path = DATA_FOLDER + version["id"] + "/" + version["id"] + ".json" + versionId = versionEntry["id"] + path = DATA_FOLDER + versionId + "/" + versionId + ".json" if not os.path.isfile(path): # download - print("Debug: Downloading %s.json" % version["id"]) + print("Debug: Downloading %s.json" % versionEntry["id"]) Path(path).parent.mkdir(parents=True, exist_ok=True) - urllib.request.urlretrieve(version["url"], path) + urllib.request.urlretrieve(versionEntry["url"], path) return ujson.load(open(path)) @@ -129,9 +132,16 @@ def replaceInFile(file, search, replace): def compilePixLyzer(): - print("Compiling pixlyzer...") + print("Compiling PixLyzer...") + compileVersion = {} + # TODO WTF + searched = searchVersion(COMPILE_VERSION) + for versionEntry in searched: + compileVersion[versionEntry] = searched[versionEntry] + + checkDeobfuscatedJars(compileVersion, getVersionJson(compileVersion)) if runAndWait('mvn clean verify') != 0: - raise Exception("Can not compile for %s" % version["id"]) + raise Exception("Can not compile PixLyzer") print("PixLyzer is now compiled")