From bf64f868d16bb757a6ce824575dd856a7edfccff Mon Sep 17 00:00:00 2001 From: Kacpherek Date: Mon, 26 Oct 2026 23:16:08 +0100 Subject: [PATCH] Send a mob's body and saddle equipment to the single player window The body slot (horse armour, llama carpet, harness, nautilus armour) was sent as the head slot and the client ignored slots 6 and 7. Send the body item as slot 6 and apply slots 6 and 7 to the fields the renderer reads. --- crates/horizon-client/src/game/lan.rs | 5 ++++- crates/horizon-client/src/game/remote.rs | 19 +++++++++++++++---- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/crates/horizon-client/src/game/lan.rs b/crates/horizon-client/src/game/lan.rs index e39fa3a68..14ce1866e 100644 --- a/crates/horizon-client/src/game/lan.rs +++ b/crates/horizon-client/src/game/lan.rs @@ -379,13 +379,16 @@ fn mob_equipment( out: &mut Vec<(u8, Option)>, ) { let e = &m.extra; + // A horse's armour, a llama's carpet, a harness: Horizon keeps the body + // slot's item (6) in `head`. + let body = horizon_client::mobs::drops::head_is_body(m.species()); let slots = [ (0u8, &e.main_hand), (1, &e.off_hand), (2, &e.feet), (3, &e.legs), (4, &e.chest), - (5, &e.head), + (if body { 6 } else { 5 }, &e.head), ]; for (slot, item) in slots { if let Some(item) = item { diff --git a/crates/horizon-client/src/game/remote.rs b/crates/horizon-client/src/game/remote.rs index 945af4585..ca0e9b35a 100644 --- a/crates/horizon-client/src/game/remote.rs +++ b/crates/horizon-client/src/game/remote.rs @@ -2013,13 +2013,22 @@ impl Game<'_> { // player holds and wears (EquipmentSlot ordinals). C::SetEquipment(p) => { self.remote_object_equipment(p.id, &p.slots); - let items: Vec<(u8, Option>)> = p + let items: Vec<(u8, Option>, Option)> = p .slots .iter() - .map(|(slot, stack)| (*slot, stack.as_ref().map(|s| self.item_name(s.item)))) + .map(|(slot, stack)| { + ( + *slot, + stack.as_ref().map(|s| self.item_name(s.item)), + self.to_stack(stack), + ) + }) .collect(); if let Some(m) = self.mobs.iter_mut().find(|m| m.id == p.id as u32) { - for (slot, item) in items { + // The body slot (6: horse armour, llama carpet, harness) + // is kept in `head`, as Horizon's own mobs do. + let body = horizon_client::mobs::drops::head_is_body(m.species()); + for (slot, item, stack) in items { let e = &mut m.extra; match slot { 0 => e.main_hand = item, @@ -2027,7 +2036,9 @@ impl Game<'_> { 2 => e.feet = item, 3 => e.legs = item, 4 => e.chest = item, - 5 => e.head = item, + 5 if !body => e.head = item, + 6 if body => e.head = item, + 7 => m.set_saddle(stack), _ => {} } }