From 913a754f2085f10eefaa5aa836a8c77b708dc5bc Mon Sep 17 00:00:00 2001 From: koka Date: Sat, 29 Aug 2026 19:54:46 +0200 Subject: [PATCH] =?UTF-8?q?fix(ambiance):=20corriger=20le=20crash=20des=20?= =?UTF-8?q?=C3=A9v=C3=A9nements=20de=20niveau?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 7 +++++++ ambiance/build.gradle | 11 ++++++++--- ...RendererMixin.java => LevelEventHandlerMixin.java} | 10 ++++------ .../src/main/resources/ambiance.client.mixins.json | 2 +- build.gradle | 9 +++++---- gradle.properties | 2 +- 6 files changed, 26 insertions(+), 15 deletions(-) rename ambiance/src/main/java/fr/koka99cab/sanctuary26/ambiance/mixin/client/{LevelRendererMixin.java => LevelEventHandlerMixin.java} (63%) diff --git a/CHANGELOG.md b/CHANGELOG.md index 48e72cf..3460945 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,13 @@ Ce journal suit les **versions du modpack**. Lorsqu'un seul module change, sa ve - Depuis `26.2.0-alpha.6`, le pack et les modules ont des versions indépendantes. I Like To Move It et Only Fun deviennent les cinquième et sixième modules actifs dans l'alpha 46. - Les versions ci-dessous ont été reconstituées à partir des JAR archivés, des packs locaux et du code source actuel. Les dates n'étant pas enregistrées de manière fiable, elles ne sont pas inventées. +## Modifications non distribuées + +Module modifié : **Ambiance `0.0.0-alpha.16`**. + +- corrige le crash client au démarrage d'Ambiance sous Minecraft 26.2 en ciblant le nouveau gestionnaire vanilla `LevelEventHandler` pour l'arrêt du disque blanc ; +- conserve les données Ambiance v2 et le protocole réseau 6, sans migration de sauvegarde. + ## `26.2.0-alpha.212` Module modifié : **Sanctuary `0.0.0-alpha.120`**. Les neuf autres modules conservent leur version issue de l'alpha.211. diff --git a/ambiance/build.gradle b/ambiance/build.gradle index c0b731d..5b08cfc 100644 --- a/ambiance/build.gradle +++ b/ambiance/build.gradle @@ -70,7 +70,7 @@ tasks.named("test") { tasks.register("verifyAmbiance") { group = "verification" - description = "Checks Ambiance alpha.15, including the bounded YouTube white-disc playback contract." + description = "Checks Ambiance alpha.16, including the Minecraft 26.2 white-disc event hook." inputs.files(fileTree("src/main/java")) inputs.files(fileTree("src/main/resources")) inputs.file(rootProject.file("pack/migrations/26.2.0-alpha.125-realtime-calendar-to-alpha.126.json")) @@ -120,8 +120,10 @@ tasks.register("verifyAmbiance") { file("src/main/resources/data/ambiance/recipe/white_disc.json")) def whiteDiscSong = new JsonSlurper().parse( file("src/main/resources/data/ambiance/jukebox_song/white_disc.json")) + def levelEventMixin = file( + "src/main/java/fr/koka99cab/sanctuary26/ambiance/mixin/client/LevelEventHandlerMixin.java").text - if (project.version.toString() != "0.0.0-alpha.15" + if (project.version.toString() != "0.0.0-alpha.16" || migration.source?.pack_version != "26.2.0-alpha.125" || migration.target?.pack_version != "26.2.0-alpha.126" || migration.target?.modules?.ambiance != "0.0.0-alpha.1" @@ -334,6 +336,9 @@ tasks.register("verifyAmbiance") { || whiteDiscRecipe.key?.W != "minecraft:white_dye" || whiteDiscSong.sound_event != "minecraft:intentionally_empty" || whiteDiscSong.length_in_seconds != 1800 + || !levelEventMixin.contains('@Mixin(LevelEventHandler.class)') + || !levelEventMixin.contains('@Inject(method = "levelEvent"') + || !levelEventMixin.contains('ambiance$stopWhiteDisc(int type, BlockPos pos, int data,') || ambianceLanguages.any { locale, translations -> !["item.ambiance.white_disc", "tooltip.ambiance.white_disc", "message.ambiance.white_disc.invalid_url", "message.ambiance.white_disc.failed"].every { @@ -342,7 +347,7 @@ tasks.register("verifyAmbiance") { } || !file("build.gradle").text.contains('dev.arbjerg:lavaplayer:2.2.7') || !file("build.gradle").text.contains('dev.lavalink.youtube:v2:1.18.2')) { - throw new GradleException("Ambiance alpha.15 white-disc playback contract is incomplete") + throw new GradleException("Ambiance alpha.16 white-disc playback contract is incomplete") } [ diff --git a/ambiance/src/main/java/fr/koka99cab/sanctuary26/ambiance/mixin/client/LevelRendererMixin.java b/ambiance/src/main/java/fr/koka99cab/sanctuary26/ambiance/mixin/client/LevelEventHandlerMixin.java similarity index 63% rename from ambiance/src/main/java/fr/koka99cab/sanctuary26/ambiance/mixin/client/LevelRendererMixin.java rename to ambiance/src/main/java/fr/koka99cab/sanctuary26/ambiance/mixin/client/LevelEventHandlerMixin.java index aa5465e..8507509 100644 --- a/ambiance/src/main/java/fr/koka99cab/sanctuary26/ambiance/mixin/client/LevelRendererMixin.java +++ b/ambiance/src/main/java/fr/koka99cab/sanctuary26/ambiance/mixin/client/LevelEventHandlerMixin.java @@ -1,19 +1,17 @@ package fr.koka99cab.sanctuary26.ambiance.mixin.client; import fr.koka99cab.sanctuary26.ambiance.client.audio.WhiteDiscAudioPlayer; -import net.minecraft.client.renderer.LevelRenderer; +import net.minecraft.client.renderer.LevelEventHandler; import net.minecraft.core.BlockPos; -import net.minecraft.world.entity.Entity; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; -@Mixin(LevelRenderer.class) -public abstract class LevelRendererMixin { +@Mixin(LevelEventHandler.class) +public abstract class LevelEventHandlerMixin { @Inject(method = "levelEvent", at = @At("HEAD")) - private void ambiance$stopWhiteDisc(Entity source, int type, BlockPos pos, int data, - CallbackInfo callback) { + private void ambiance$stopWhiteDisc(int type, BlockPos pos, int data, CallbackInfo callback) { if (type == 1011) WhiteDiscAudioPlayer.stop(pos); } } diff --git a/ambiance/src/main/resources/ambiance.client.mixins.json b/ambiance/src/main/resources/ambiance.client.mixins.json index 86b18c4..d0bdf39 100644 --- a/ambiance/src/main/resources/ambiance.client.mixins.json +++ b/ambiance/src/main/resources/ambiance.client.mixins.json @@ -11,7 +11,7 @@ "GameRendererMixin", "LightCoordsUtilMixin", "LightmapRenderStateExtractorMixin", - "LevelRendererMixin", + "LevelEventHandlerMixin", "SoundEngineAccessor", "SoundManagerAccessor", "SkyRendererMixin" diff --git a/build.gradle b/build.gradle index 376e4a5..fbc5206 100644 --- a/build.gradle +++ b/build.gradle @@ -4548,7 +4548,7 @@ tasks.register("verifyWeatherTntAmbianceRelease") { def ouchManifest = new JsonSlurper().parse(file("ouch/src/main/resources/fabric.mod.json")) def rootBuild = file("build.gradle").text if (rootProject.pack_version != "26.2.0-alpha.212" - || rootProject.ambiance_version != "0.0.0-alpha.15" + || rootProject.ambiance_version != "0.0.0-alpha.16" || rootProject.ouch_version != "0.0.0-alpha.10" || migration.source?.pack_version != "26.2.0-alpha.199" || migration.source?.modules != [ambiance: "0.0.0-alpha.11", ouch: "0.0.0-alpha.8"] @@ -5319,7 +5319,7 @@ tasks.register("verifyCanapliaFoundation") { "ambiance/src/main/java/fr/koka99cab/sanctuary26/ambiance/api/visual/AmbianceVisualEffectApi.java").text if (rootProject.pack_version != "26.2.0-alpha.212" || rootProject.itsalive_version != "0.0.0-alpha.36" - || rootProject.ambiance_version != "0.0.0-alpha.15" + || rootProject.ambiance_version != "0.0.0-alpha.16" || migration.issue != 35 || migration.source?.fabric_id != "canaplia" || migration.source?.version != "2.0.0" @@ -5570,7 +5570,7 @@ tasks.register("verifyCanapliaAlpha209Release") { itsalive: "0.0.0-alpha.33", onlyfun: "0.0.0-alpha.20"] if (rootProject.pack_version != "26.2.0-alpha.212" - || rootProject.ambiance_version != "0.0.0-alpha.15" + || rootProject.ambiance_version != "0.0.0-alpha.16" || rootProject.itsalive_version != "0.0.0-alpha.36" || rootProject.onlyfun_version != "0.0.0-alpha.24" || migration.source?.pack_version != "26.2.0-alpha.207" @@ -5783,6 +5783,7 @@ tasks.register("verifyAlpha211Release") { ouch: "0.0.0-alpha.10", sanctuary: "0.0.0-alpha.119"] def currentModules = expectedTarget + [sanctuary: "0.0.0-alpha.120"] + def workspaceModules = currentModules + [ambiance: "0.0.0-alpha.16"] def expectedDataVersions = [ambiance: 2, itsalive: 3, onlyfun: 2, ouch: 1, sanctuary: 11] def expectedProtocols = [ambiance: 6, itsalive: 4, onlyfun: 3, ouch: 1, sanctuary: 22] def manifests = expectedTarget.collectEntries { id, version -> @@ -5808,7 +5809,7 @@ tasks.register("verifyAlpha211Release") { it.path == "mods/jei-26.2-fabric-30.28.0.193.jar" } if (rootProject.pack_version != "26.2.0-alpha.212" - || currentModules.any { id, version -> rootProject.property("${id}_version") != version } + || workspaceModules.any { id, version -> rootProject.property("${id}_version") != version } || migration.source?.pack_version != "26.2.0-alpha.210" || migration.source?.modules != expectedSource || migration.target?.pack_version != "26.2.0-alpha.211" diff --git a/gradle.properties b/gradle.properties index 113ebd9..c98c0ad 100644 --- a/gradle.properties +++ b/gradle.properties @@ -12,7 +12,7 @@ fabric_api_version=0.158.0+26.2 # Standby modules stay at zero until their migration really begins. mod_version=0.0.0-alpha.0 module_lifecycle=standby -ambiance_version=0.0.0-alpha.15 +ambiance_version=0.0.0-alpha.16 ambiance_lifecycle=active redstoner_version=0.0.0-alpha.10 redstoner_lifecycle=active -- 2.54.0