From fb1142cd71dba47247f5f897c8ff487362431413 Mon Sep 17 00:00:00 2001 From: Ludovic Marie <136255825+ludovic111@users.noreply.github.com> Date: Sun, 25 Oct 2026 14:31:41 +0100 Subject: [PATCH] Skins: keep vanilla's whole-payload rejection, drop the dead name fallback authlib 10.0.77 MinecraftServicesSessionService.unpackTextures returns MinecraftProfileTextures.EMPTY when any texture has no URL or a URL outside the allowed domains, so skins::unpack goes back to main's behaviour. remote_player_names: r.players and r.tab_players are filled from the same ADD_PLAYER entries and emptied by the same PlayerInfoRemove, so the tab-list fallback could never apply. Co-Authored-By: Claude Opus 5.5 --- crates/horizon-client/src/game/remote.rs | 9 +-------- crates/horizon-client/src/hud.rs | 5 +++-- crates/horizon-client/src/skins.rs | 21 ++++++++++----------- 3 files changed, 14 insertions(+), 21 deletions(-) diff --git a/crates/horizon-client/src/game/remote.rs b/crates/horizon-client/src/game/remote.rs index 36122d42a..74850110b 100644 --- a/crates/horizon-client/src/game/remote.rs +++ b/crates/horizon-client/src/game/remote.rs @@ -5068,14 +5068,7 @@ impl Game<'_> { r.level_players .iter() .filter(|(_, uuid)| **uuid != r.profile) - .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)) - }) + .filter_map(|(id, uuid)| Some((*id as u32, r.players.get(uuid)?.clone()))) .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 90a8b346c..617126c2e 100644 --- a/crates/horizon-client/src/hud.rs +++ b/crates/horizon-client/src/hud.rs @@ -78,8 +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. -/// Vanilla registers a texture per skin; too few slots evict a busy -/// server's players back to their default skins. +/// Vanilla registers a texture per skin. Here a skin evicted from its slot +/// is not stored again, and its player falls back to the default skin, so +/// the slots must cover a busy server's player list. pub const SKIN_SLOTS: usize = 128; /// Reused by the visible rows of the classic world selector. pub const WORLD_ICON_SLOTS: usize = 32; diff --git a/crates/horizon-client/src/skins.rs b/crates/horizon-client/src/skins.rs index 0cf9cc8a2..9014032c4 100644 --- a/crates/horizon-client/src/skins.rs +++ b/crates/horizon-client/src/skins.rs @@ -92,23 +92,22 @@ 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, }; - // 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()); - } + *slot = Some(url.to_owned()); } out }