diff --git a/crates/horizon-client/src/game/remote.rs b/crates/horizon-client/src/game/remote.rs index 5a71b13a8..36122d42a 100644 --- a/crates/horizon-client/src/game/remote.rs +++ b/crates/horizon-client/src/game/remote.rs @@ -1006,6 +1006,9 @@ impl Game<'_> { r.stepped.clear(); r.head_lerps.clear(); r.pending_items.clear(); + // The entity ids are the old world's; the new dimension's + // player entities re-map to their profiles on AddEntity. + r.level_players.clear(); // A new ClientLevel: a new chunk storage, centred on 0, 0. r.chunk_center = (0, 0); } @@ -5065,7 +5068,14 @@ impl Game<'_> { r.level_players .iter() .filter(|(_, uuid)| **uuid != r.profile) - .filter_map(|(id, uuid)| Some((*id as u32, r.players.get(uuid)?.clone()))) + .filter_map(|(id, uuid)| { + let name = r + .players + .get(uuid) + .cloned() + .or_else(|| r.tab_players.get(uuid).map(|t| t.name.clone()))?; + Some((*id as u32, name)) + }) .collect() } /// `ClientClockManager.tick`: the clock moves on by the game time that diff --git a/crates/horizon-client/src/hud.rs b/crates/horizon-client/src/hud.rs index 89d1b1c3c..90a8b346c 100644 --- a/crates/horizon-client/src/hud.rs +++ b/crates/horizon-client/src/hud.rs @@ -78,7 +78,9 @@ pub const MAP_SLOTS: usize = 256; /// The atlas slot the minimap extra draws into. pub const MINIMAP_SPRITE: &str = "horizon/minimap"; /// Atlas slots for downloaded player skins (`skins/`), 64x64 each. -pub const SKIN_SLOTS: usize = 32; +/// Vanilla registers a texture per skin; too few slots evict a busy +/// server's players back to their default skins. +pub const SKIN_SLOTS: usize = 128; /// Reused by the visible rows of the classic world selector. pub const WORLD_ICON_SLOTS: usize = 32; /// Atlas slots for the pack icons on the pack screen, one per icon drawn diff --git a/crates/horizon-client/src/skins.rs b/crates/horizon-client/src/skins.rs index 9014032c4..0cf9cc8a2 100644 --- a/crates/horizon-client/src/skins.rs +++ b/crates/horizon-client/src/skins.rs @@ -92,22 +92,23 @@ pub fn unpack(value: &str, signature: Signature, valid_uris: &[&str]) -> Texture ..empty.clone() }; for (kind, texture) in textures { - let Some(url) = texture.get("url").and_then(|u| u.as_str()) else { - return empty; - }; - let allowed = valid_uris - .iter() - .any(|u| url.starts_with(&u.replace("{textureId}", ""))); - if !allowed { - return empty; - } let slot = match kind.as_str() { "SKIN" => &mut out.skin, "CAPE" => &mut out.cape, "ELYTRA" => &mut out.elytra, _ => continue, }; - *slot = Some(url.to_owned()); + // One bad entry (no `url`, or a URL outside the texture services' + // domains) drops only that texture, not the whole payload. + let Some(url) = texture.get("url").and_then(|u| u.as_str()) else { + continue; + }; + let allowed = valid_uris + .iter() + .any(|u| url.starts_with(&u.replace("{textureId}", ""))); + if allowed { + *slot = Some(url.to_owned()); + } } out }