Pala: tâche runClient (dev visuel sans loom)
This commit is contained in:
@@ -94,3 +94,64 @@ processResources {
|
|||||||
java {
|
java {
|
||||||
withSourcesJar()
|
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'
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user