Switch to the MCPHackers launchwrapper

This commit is contained in:
zontreck 2024-03-17 02:00:25 -07:00
parent 291e0e7d6a
commit 1c993f6a57
2 changed files with 34 additions and 8 deletions

View file

@ -66,6 +66,9 @@ dependencies {
provided "org.lwjgl.lwjgl:lwjgl_util:$lwjglVersion"
provided platform("org.lwjgl.lwjgl:lwjgl-platform:$lwjglVersion-$lwjglNatives")
provided 'org.mcphackers:launchwrapper:1.0'
}
// Apply a specific Java toolchain to ease working on different environments.
@ -77,10 +80,11 @@ java {
application {
// Define the main class for the application.
mainClass = 'com.mojang.minecraft.Minecraft'
mainClass = 'org.mcphackers.launchwrapper.Launch'
}
jar {
duplicatesStrategy = "exclude"
manifest {
attributes (
'Main-Class': application.mainClass,
@ -125,6 +129,34 @@ task jarjar(type: Jar) {
with copyNatives
}
run {
jvmArgs ["-Djava.library.path=${project.nativeLibsDir}",]
}
jar.finalizedBy(jarjar)
jar.finalizedBy(copyToLib)
jar.finalizedBy(copyNatives)
jar.finalizedBy(copyNatives)
task buildServer(type: Jar){
manifest {
attributes(
'Main-Class': "com.mojang.minecraft.server.MinecraftServer",
"Multi-Release": 'true'
)
} from {
configurations.provided.collect { it.isDirectory() ? it : zipTree(it)}
}
archiveClassifier = "server"
duplicatesStrategy = "exclude"
from {configurations.provided.collect {it.isDirectory()?it:zipTree(it)}}
exclude 'META-INF/*'
with jarjar
}
jar.finalizedBy(buildServer)

View file

@ -1078,10 +1078,4 @@ public final class Minecraft implements Runnable {
System.gc();
}
public static void main(String[] args) throws LWJGLException {
Minecraft minecraft = new Minecraft((Canvas)null, 854, 480, false);
(new Thread(minecraft)).start();
}
}