From 4eb9f850ca6fcd9e805d753d5fa0a3f6941980ea Mon Sep 17 00:00:00 2001 From: kisakay Date: Sun, 18 Oct 2026 22:44:59 +0200 Subject: [PATCH] =?UTF-8?q?Pala:=20t=C3=A2che=20runClient=20(dev=20visuel?= =?UTF-8?q?=20sans=20loom)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mods/pala/build.gradle | 61 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) diff --git a/mods/pala/build.gradle b/mods/pala/build.gradle index 35df9be..a7fbb9f 100644 --- a/mods/pala/build.gradle +++ b/mods/pala/build.gradle @@ -94,3 +94,64 @@ processResources { java { withSourcesJar() } + +// Dev : lance le vrai client MC 26.3 + pala (sans loom). +// Requiert un premier lancement SurviePote/Prism (common/ rempli : versions, libraries, assets). +// Usage : ./gradlew runClient (monde solo offline dispo pour vérifier visuels). +def survieCommon = new File(System.getProperty('user.home'), '.surviepote/common') + +tasks.register('extractClientNatives', Copy) { + dependsOn('downloadMcLibs') + def mcVersion = project.minecraft_version + def versionJson = new groovy.json.JsonSlurper().parse( + new File(survieCommon, "versions/${mcVersion}/${mcVersion}.json")) + from(versionJson.libraries.findAll { lib -> + lib.name.contains(':natives-linux') && (lib.rules == null || lib.rules.any { it.action == 'allow' && (it.os == null || it.os.name == 'linux') }) + }.collect { lib -> + def art = lib.downloads.artifact + zipTree(new File(survieCommon, "libraries/${art.path}")) + }) + into(layout.buildDirectory.dir('runClient/natives')) + include('**/*.so') + eachFile { f -> f.path = f.name } +} + +tasks.register('runClient', JavaExec) { + dependsOn('extractClientNatives', 'jar') + group = 'fabric' + description = 'Lance le client Minecraft avec le mod (dev visuel).' + javaLauncher = javaToolchains.launcherFor { languageVersion = JavaLanguageVersion.of(25) } + def mcVersion = project.minecraft_version + def versionJson = new groovy.json.JsonSlurper().parse( + new File(survieCommon, "versions/${mcVersion}/${mcVersion}.json")) + def loaderVersion = project.loader_version + def fabricJson = new groovy.json.JsonSlurper().parse( + new File(survieCommon, "versions/${mcVersion}-fabric-${loaderVersion}/${mcVersion}-fabric-${loaderVersion}.json")) + def mavenToPath = { String coord -> + def parts = coord.split(':') + return "${parts[0].replace('.', '/')}/${parts[1]}/${parts[2]}/${parts[1]}-${parts[2]}.jar" + } + classpath = files( + new File(survieCommon, "versions/${mcVersion}/${mcVersion}.jar"), + versionJson.libraries.findAll { lib -> + !(lib.name.contains(':natives-')) && (lib.rules == null || lib.rules.any { it.action == 'allow' && (it.os == null || it.os.name == 'linux') }) + }.collect { new File(survieCommon, "libraries/${it.downloads.artifact.path}") }, + fabricJson.libraries.collect { new File(survieCommon, "libraries/${mavenToPath(it.name)}") }, + sourceSets.main.output, + sourceSets.main.resources + ) + mainClass = 'net.fabricmc.loader.impl.launch.knot.KnotClient' + args = [ + '--gameDir', layout.buildDirectory.dir('runClient/game').get().asFile.absolutePath, + '--assetsDir', new File(survieCommon, 'assets').absolutePath, + '--assetIndex', '34', + '--version', 'pala-dev', + '--username', 'Dev', '--uuid', '00000000-0000-0000-0000-000000000000', + '--accessToken', '0', '--versionType', 'release' + ] + jvmArgs = [ + "-Djava.library.path=${layout.buildDirectory.dir('runClient/natives').get().asFile.absolutePath}", + '-Xmx4G' + ] + systemProperties['org.lwjgl.util.Debug'] = 'false' +}