Merge pull request #1090 from ludovic111/fix/missingno-warning
🤖 Agent: merged after integration C: the desktop ran 322/325 harnesses on main + #1088–#1093, and its 3 failures were the known dedicated_server flake plus the two display harnesses; world_reopen and save_roundtrip pass on the Mac mini (main + the six branches).
This commit is contained in:
@@ -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())
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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<u8> = (0..SPRITE_SIZE * SPRITE_SIZE)
|
||||
|
||||
Reference in New Issue
Block a user