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)