fix(ambiance): corriger le crash des événements de niveau #82

Merged
koka merged 1 commits from fix/ambiance-level-event-crash into main 2026-08-29 17:57:58 +00:00
6 changed files with 26 additions and 15 deletions
+7
View File
@@ -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.
+8 -3
View File
@@ -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")
}
[
@@ -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);
}
}
@@ -11,7 +11,7 @@
"GameRendererMixin",
"LightCoordsUtilMixin",
"LightmapRenderStateExtractorMixin",
"LevelRendererMixin",
"LevelEventHandlerMixin",
"SoundEngineAccessor",
"SoundManagerAccessor",
"SkyRendererMixin"
+5 -4
View File
@@ -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"
+1 -1
View File
@@ -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