fix some bugs

This commit is contained in:
Bixilon 2021-03-09 23:08:16 +01:00
parent 3cf0604b9b
commit 6c37e8ed42
No known key found for this signature in database
GPG Key ID: 5CAD791931B09AC4
2 changed files with 32 additions and 14 deletions

View File

@ -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/)

View File

@ -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")