[PR #4767] [MERGED] Villagers and wandering traders hold items in crossed arms (CrossedArmsItemLayer) #5839

Closed
opened 2026-11-03 05:15:20 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/4767
Author: @levzzz5154
Created: 10/30/2026
Status: ✅ Merged
Merged: 10/30/2026
Merged by: @levzzz5154

Base: main ← Head: parity/51-crossed-arms


📝 Commits (1)

  • 33d8b6e CrossedArmsItemLayer: villagers and wandering traders show their held item; ShowTradesToPlayer displays matching offers

📊 Changes

4 files changed (+127 additions, -15 deletions)

View changed files

📝 crates/horizon-client/src/game/lan.rs (+1 -1)
📝 crates/horizon-client/src/mobs/render.rs (+44 -8)
📝 crates/horizon-client/src/mobs/trader.rs (+8 -1)
📝 crates/horizon-client/src/mobs/villager_brain.rs (+74 -5)

📄 Description

🤖 Opened by levzzz5154's AI agent (Claude Code, Claude Sonnet 5.5), not by levzzz5154 personally.

Part of #3519

Rows:

  • CrossedArmsItemLayer.submit: villagers and wandering traders now draw their main-hand item (held_item_transform had no branch for them, the arms part was never looked up).
  • CrossedArmsItemLayer.applyTranslation: shared crossed_arms_matrix (translateToArms, X 0.75, scale 1.07, translate 0/0.13/-0.34, X pi), now used by the witch and the villager family.

Server-side held item sync, so the layer has something to show:

  • ShowTradesToPlayer (findItemsToDisplay, displayCyclingItems, clearHeldItem): the villager holds the results of offers whose cost matches the player's main-hand item, cycling every 40 ticks, cleared on stop. Also lookTime = min(lookTime, 40) now only applies when nothing is displayed, as in vanilla.
  • UseItemGoal (wandering trader): the invisibility potion keeps its contents.
  • mob_equipment (lan.rs) now sends the main hand's full stack when the mob has one, so components reach clients.

Checked and already fixed on main (no change): PhantomRenderer.scale (render.rs species_scale Phantom, test the_phantom_model_sits_in_its_box), PlayerModel.setupAnim (anim.rs player_model_visibility).

Vanilla followed: CrossedArmsItemLayer.submit/applyTranslation, VillagerModel.translateToArms, ShowTradesToPlayer, UseItemGoal.
Tests: villagers_and_traders_hold_items_in_crossed_arms; fmt, clippy -D warnings, villager tests pass.

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon/pull/4767 **Author:** [@levzzz5154](https://github.com/levzzz5154) **Created:** 10/30/2026 **Status:** ✅ Merged **Merged:** 10/30/2026 **Merged by:** [@levzzz5154](https://github.com/levzzz5154) **Base:** `main` ← **Head:** `parity/51-crossed-arms` --- ### 📝 Commits (1) - [`33d8b6e`](https://github.com/horizon-rust/horizon/commit/33d8b6ebeb22dbe1e4fb4e34e50f80824cd4cbfb) CrossedArmsItemLayer: villagers and wandering traders show their held item; ShowTradesToPlayer displays matching offers ### 📊 Changes **4 files changed** (+127 additions, -15 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/lan.rs` (+1 -1) 📝 `crates/horizon-client/src/mobs/render.rs` (+44 -8) 📝 `crates/horizon-client/src/mobs/trader.rs` (+8 -1) 📝 `crates/horizon-client/src/mobs/villager_brain.rs` (+74 -5) </details> ### 📄 Description > 🤖 Opened by levzzz5154's AI agent (Claude Code, Claude Sonnet 5.5), not by levzzz5154 personally. Part of #3519 Rows: - `CrossedArmsItemLayer.submit`: villagers and wandering traders now draw their main-hand item (`held_item_transform` had no branch for them, the arms part was never looked up). - `CrossedArmsItemLayer.applyTranslation`: shared `crossed_arms_matrix` (translateToArms, X 0.75, scale 1.07, translate 0/0.13/-0.34, X pi), now used by the witch and the villager family. Server-side held item sync, so the layer has something to show: - `ShowTradesToPlayer` (findItemsToDisplay, displayCyclingItems, clearHeldItem): the villager holds the results of offers whose cost matches the player's main-hand item, cycling every 40 ticks, cleared on stop. Also `lookTime = min(lookTime, 40)` now only applies when nothing is displayed, as in vanilla. - `UseItemGoal` (wandering trader): the invisibility potion keeps its contents. - `mob_equipment` (lan.rs) now sends the main hand's full stack when the mob has one, so components reach clients. Checked and already fixed on main (no change): `PhantomRenderer.scale` (render.rs `species_scale` Phantom, test `the_phantom_model_sits_in_its_box`), `PlayerModel.setupAnim` (anim.rs `player_model_visibility`). Vanilla followed: CrossedArmsItemLayer.submit/applyTranslation, VillagerModel.translateToArms, ShowTradesToPlayer, UseItemGoal. Tests: `villagers_and_traders_hold_items_in_crossed_arms`; fmt, clippy -D warnings, villager tests pass. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 05:15:20 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon#5839
No description provided.