pix some loading bugs

This commit is contained in:
Bixilon 2021-04-08 14:24:48 +02:00
parent 6a0b10100a
commit 5fa43d52b1
No known key found for this signature in database
GPG Key ID: 5CAD791931B09AC4
3 changed files with 7 additions and 13 deletions

View File

@ -17,7 +17,7 @@
<kotlin.compiler.jvmTarget>1.8</kotlin.compiler.jvmTarget>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<minecraft.version>1.15-pre3</minecraft.version>
<minecraft.version>21w14a</minecraft.version>
</properties>
<repositories>

View File

@ -4,10 +4,9 @@ import com.google.gson.GsonBuilder
import com.google.gson.JsonObject
import de.bixilon.pixlyzer.generator.Generators
import de.bixilon.pixlyzer.util.ReflectionUtil.getClass
import de.bixilon.pixlyzer.util.ReflectionUtil.getGetter
import de.bixilon.pixlyzer.util.Util
import net.minecraft.Bootstrap
import net.minecraft.MinecraftVersion
import net.minecraft.SharedConstants
import net.minecraft.util.registry.Registry
import java.io.File
import java.io.FileInputStream
@ -36,8 +35,8 @@ object PixLyzer {
fun main(args: Array<String>) {
println("Starting PixLyzer")
if (args.size != 3) {
error("Usage: java -cp minecraft,pixlyzer de.bixilon.pixlyzer.PixLyzer <Output directory> <Hash directory> <Assets index>")
if (args.size != 4) {
error("Usage: java -cp minecraft,pixlyzer de.bixilon.pixlyzer.PixLyzer <Output directory> <Hash directory> <Assets index> <Version id>")
}
val outputDirectory = File(args[0])
@ -45,6 +44,7 @@ object PixLyzer {
val hashDirectory = File(args[1])
hashDirectory.mkdirs()
val assetsIndex = File(args[2])
val versionId = args[3]
try {
@ -145,8 +145,6 @@ object PixLyzer {
val assetsIndexJson = Util.readJsonFile(assetsIndex.absolutePath + ".json")
val versionId = MinecraftVersion.create().name // ToDo: Should be id, but in 1.14 there is a hash in the id???
assetsIndexJson.addProperty(versionId, hash)
writeJson(assetsIndex.absolutePath, assetsIndexJson)
@ -166,9 +164,5 @@ object PixLyzer {
}
val initializeGameVersionMethod = try {
getClass(SharedConstants::class.java.simpleName)?.getDeclaredMethod("method_36208")
} catch (exception: Exception) {
null
}
private val initializeGameVersionMethod = getGetter(getClass("net.minecraft.SharedConstants"), "method_36208")
}

View File

@ -210,7 +210,7 @@ for version in VERSION_MANIFEST["versions"]:
versionStartTime = datetime.now()
print("Generating data for %s" % version["id"])
# execute
if runAndWait("%s -Xverify:none -classpath \"%s:%s:%s:%s\" de.bixilon.pixlyzer.PixLyzer \"%s\" \"%s\" \"%s\"" % (JAVA_PATH, ADDITIONAL_CLASSPATH, DATA_FOLDER + version["id"] + "_yarn/" + version["id"] + "-named.jar", DATA_FOLDER + version["id"] + "_yarn/" + version["id"] + "_server_mojang.jar", "target/classes", OUT_FOLDER + version["id"], HASH_FOLDER, ASSETS_HASH_INDEX_FILE)) != 0:
if runAndWait("%s -Xverify:none -classpath \"%s:%s:%s:%s\" de.bixilon.pixlyzer.PixLyzer \"%s\" \"%s\" \"%s\" \"%s\"" % (JAVA_PATH, ADDITIONAL_CLASSPATH, DATA_FOLDER + version["id"] + "_yarn/" + version["id"] + "-named.jar", DATA_FOLDER + version["id"] + "_yarn/" + version["id"] + "_server_mojang.jar", "target/classes", OUT_FOLDER + version["id"], HASH_FOLDER, ASSETS_HASH_INDEX_FILE, version["id"])) != 0:
print("PixLyzer did not run successfully for %s" % version["id"])
break