From 57cc113be4bf3042bd64e260f2349308270031f1 Mon Sep 17 00:00:00 2001 From: Ludovic Marie <136255825+ludovic111@users.noreply.github.com> Date: Wed, 21 Oct 2026 17:37:45 +0200 Subject: [PATCH] Client logs: no warning for minecraft:missingno; say when no sounds loaded - sprites: vanilla models name the missing texture on purpose (block/air.json's particle is minecraft:missingno), so using it is not worth a warning (#853). - audio: when the resources hold no sounds.json, the game plays nothing on a working output and the log said only which device opened. It now says the sounds were not copied and how to fix it (#1035, #1076). Co-Authored-By: Claude Opus 5.5 --- crates/horizon-client/src/audio.rs | 9 +++++++++ crates/horizon-client/src/sound_events.rs | 5 +++++ crates/horizon-client/src/sprites.rs | 6 +++++- 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/crates/horizon-client/src/audio.rs b/crates/horizon-client/src/audio.rs index 250babf22..62bdc041f 100644 --- a/crates/horizon-client/src/audio.rs +++ b/crates/horizon-client/src/audio.rs @@ -498,6 +498,15 @@ impl Audio { } fn with_output(root: &Path, output: bool) -> Self { let registry = SoundRegistry::load(root); + if output && registry.is_empty() { + // The game then plays nothing on a working output (#1035, #1076). + log::warn!( + "Horizon: no sounds in {}: they were not copied from your Minecraft \ + install; prepare the game again in the launcher (or run \ + horizon-prepare sounds)", + root.join("assets").display() + ); + } let mixer = Arc::new(Mutex::new(Mixer::default())); let opened = if output { Self::open(mixer.clone()) diff --git a/crates/horizon-client/src/sound_events.rs b/crates/horizon-client/src/sound_events.rs index 3304ca4a9..2d7b2e21a 100644 --- a/crates/horizon-client/src/sound_events.rs +++ b/crates/horizon-client/src/sound_events.rs @@ -246,6 +246,11 @@ impl SoundRegistry { } registry } + /// No sound event at all: the resources hold no `sounds.json` (sounds not + /// imported from the player's launcher when the game was prepared). + pub fn is_empty(&self) -> bool { + self.events.is_empty() + } /// One `sounds.json` (`Preparations.handleRegistration` for each entry). /// `exists(namespace, path)` says whether a sound file is present. pub fn add_file(&mut self, namespace: &str, text: &[u8], exists: &dyn Fn(&str, &str) -> bool) { diff --git a/crates/horizon-client/src/sprites.rs b/crates/horizon-client/src/sprites.rs index e3caf1de4..b89983966 100644 --- a/crates/horizon-client/src/sprites.rs +++ b/crates/horizon-client/src/sprites.rs @@ -147,7 +147,11 @@ impl Sprites { match self.load(root, name) { Ok(layer) => Ok(layer), Err(e) => { - log::warn!("Horizon: using the missing texture for {name}: {e}"); + // `MissingTextureAtlasSprite.getLocation()`: vanilla models name the + // missing texture on purpose (block/air.json's particle), #853. + if name != "minecraft:missingno" { + log::warn!("Horizon: using the missing texture for {name}: {e}"); + } // MissingTextureAtlasSprite.generateMissingImage: 16x16, // magenta and black quarters. let frame: Vec = (0..SPRITE_SIZE * SPRITE_SIZE)