nosingleplayer 1.1.3: fix connexion + bouton Quitter SurviePote

- TitleScreenMixin : TransferState null sur startConnecting -> connexion
  normale, corrige "This server does not accept transfers".
- PauseScreenMixin (nouveau) : renomme le bouton de deconnexion du menu
  Echap en "Quitter SurviePote" et redirige vers l'ecran d'accueil
  (TitleScreen) au lieu de la liste des serveurs.
- build.gradle : tache runClient (dev sans loom) reutilisant
  ~/.surviepote/common.
- Jar 1.1.3 copie dans l'atlas + distribution.json regenere.
This commit is contained in:
Anaïs Saraiva
2026-10-19 18:41:56 +02:00
parent 159a594b2c
commit 4a48d2c721
9 changed files with 158 additions and 13 deletions
+94
View File
@@ -64,3 +64,97 @@ processResources {
java {
withSourcesJar()
}
// ---------------------------------------------------------------------------
// Dev : lance le vrai client MC 26.3 + nosingleplayer (build sans loom).
// Réutilise l'installation commune du launcher SurviePote (~/.surviepote/common :
// versions, libraries, assets — remplie au premier lancement). Le mod est copié
// dans runClient/game/mods/ (Knot le découvre comme un mod Fabric classique).
// Usage : ./gradlew runClient
// ---------------------------------------------------------------------------
def survieCommon = new File(System.getProperty('user.home'), '.surviepote/common')
def mcVersion = project.minecraft_version
def loaderVersion = project.loader_version
tasks.register('extractClientNatives', Copy) {
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 ->
zipTree(new File(survieCommon, "libraries/${lib.downloads.artifact.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, sans loom).'
def versionJson = new groovy.json.JsonSlurper().parse(
new File(survieCommon, "versions/${mcVersion}/${mcVersion}.json"))
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"
}
doFirst {
def modsDir = layout.buildDirectory.dir('runClient/game/mods').get().asFile
delete(modsDir)
modsDir.mkdirs()
copy {
from(tasks.named('jar'))
into(modsDir)
}
}
// NixOS : dlopen ne voit ni libGL ni libvulkan sans LD_LIBRARY_PATH (cf launcher).
def nixStore = new File('/nix/store')
def glDirs = []
['/run/opengl-driver/lib', '/run/current-system/sw/lib'].each { d ->
if (new File(d).exists()) glDirs << d
}
if (nixStore.exists()) {
nixStore.eachDir { e ->
def n = e.name
if (n.contains('libglvnd') || n.contains('vulkan-loader') || n.contains('alsa-lib')
|| n.contains('pulseaudio') || (n.contains('pipewire') && !n.contains('python'))) {
def lib = new File(e, 'lib')
if (lib.exists()) glDirs << lib.absolutePath
}
}
}
def prevLd = System.getenv('LD_LIBRARY_PATH')
environment('LD_LIBRARY_PATH', (prevLd ? prevLd + ':' : '') + glDirs.join(':'))
if (!System.getenv('SDL_VIDEODRIVER') && (System.getenv('WAYLAND_DISPLAY') || new File('/run/user/1000/wayland-1').exists())) {
environment('SDL_VIDEODRIVER', 'wayland')
}
javaLauncher = javaToolchains.launcherFor { languageVersion = JavaLanguageVersion.of(25) }
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)}") }
)
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', versionJson.assetIndex.id,
'--version', "${project.archives_base_name}-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'
}