[PR #1468] [MERGED] Maps in one hand: the off hand, or the main hand beside an item, draws the map #3546

Closed
opened 2026-11-03 04:10:19 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/1468
Author: @ludovic111
Created: 10/23/2026
Status: ✅ Merged
Merged: 10/24/2026
Merged by: @ludovic111

Base: main ← Head: fix/one-handed-maps


📝 Commits (2)

  • 8ef418e Maps in one hand: the off hand, or the main hand beside an item, draws the map
  • c19418b Merge remote-tracking branch 'origin/main' into fix/one-handed-maps

📊 Changes

3 files changed (+156 additions, -20 deletions)

View changed files

📝 crates/horizon-client/src/first_person.rs (+120 -0)
📝 crates/horizon-client/src/game.rs (+23 -8)
📝 crates/horizon-client/src/game/maps.rs (+13 -12)

📄 Description

🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself.

Fixes #1459: a map held in the off hand, or in the main hand while the off hand holds something, was drawn as the flat item model.

Vanilla 26.3

FirstPersonHandsAndItemsRenderer.submitArmWithItem: a stack with a map_id is drawn by renderTwoHandedMap only when it is in the main hand and the off hand is empty. Every other held map is drawn by renderOneHandedMap in its own hand.

Change

  • first_person::MapHold::of(hand, off_hand_empty) picks which of the two cases applies.
  • one_handed_map_pose is renderOneHandedMap's transform. A unit test compares it with matrices from vanilla's own PoseStack (computed by a small Java oracle), in three cases: the right hand at rest, the left hand lowered 0.25 during a swing (attack 0.3), and the right hand lowered 0.6 late in a swing (attack 0.85).
  • maps::held_map (renderMap: background, map and decorations) is shared by both cases.
  • Not changed: the arms under held maps are still not drawn, as before this PR.

Tests

  • first_person tests: 13 pass, including a_map_is_two_handed_only_in_the_main_hand_with_an_empty_off_hand and one_handed_maps_follow_render_one_handed_map (these are new; main has no one-handed case).
  • In game (Mac mini, Metal, offscreen 1280x720), in-frame and --server-thread:
before (main) after

All four cases after the change (two-handed, main hand with a torch in the off hand, off hand only, a map in both hands):
The off-hand map on --server-thread:

I couldn't capture the vanilla client next to these: the Mac mini session is locked, so only Horizon's own offscreen screenshots work. The pose is checked numerically against vanilla's PoseStack instead.

Self-check

These checks ran on one integration commit with #1467, #1468, #1469, #1470 and #1471 merged on main (Mac mini):

  • cargo fmt --all -- --check: clean
  • cargo clippy --workspace --all-targets -- -D warnings: clean. The first run was on main at 8a4ebcc55, with the two functions #1472 restores added in a local commit. The final run, on main with #1472 merged, is clean too.
  • cargo test -p horizon-client --lib: 1063 passed. --bins: 98 + 18 passed.
  • tools/parity.py --changed origin/main: 309/310 passed in 69.8 min, the same run as the clippy check above. The one failure, menu_click, was the loom case fixed in #1467's second commit. On the refreshed integration commit (main with #1472, plus all five branches), menu_click passes: 8000/8000 with seed 7 and with seed 11.

Needs Ludovic

Nothing.

🤖 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/1468 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/23/2026 **Status:** ✅ Merged **Merged:** 10/24/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/one-handed-maps` --- ### 📝 Commits (2) - [`8ef418e`](https://github.com/horizon-rust/horizon/commit/8ef418e223eed07d4ca2215e6f0d3016890bb76c) Maps in one hand: the off hand, or the main hand beside an item, draws the map - [`c19418b`](https://github.com/horizon-rust/horizon/commit/c19418b55db2c69d74e097e81470ca69e1bbbf5c) Merge remote-tracking branch 'origin/main' into fix/one-handed-maps ### 📊 Changes **3 files changed** (+156 additions, -20 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/first_person.rs` (+120 -0) 📝 `crates/horizon-client/src/game.rs` (+23 -8) 📝 `crates/horizon-client/src/game/maps.rs` (+13 -12) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. Fixes #1459: a map held in the off hand, or in the main hand while the off hand holds something, was drawn as the flat item model. ## Vanilla 26.3 `FirstPersonHandsAndItemsRenderer.submitArmWithItem`: a stack with a `map_id` is drawn by `renderTwoHandedMap` only when it is in the main hand and the off hand is empty. Every other held map is drawn by `renderOneHandedMap` in its own hand. ## Change - `first_person::MapHold::of(hand, off_hand_empty)` picks which of the two cases applies. - `one_handed_map_pose` is `renderOneHandedMap`'s transform. A unit test compares it with matrices from vanilla's own `PoseStack` (computed by a small Java oracle), in three cases: the right hand at rest, the left hand lowered 0.25 during a swing (attack 0.3), and the right hand lowered 0.6 late in a swing (attack 0.85). - `maps::held_map` (`renderMap`: background, map and decorations) is shared by both cases. - Not changed: the arms under held maps are still not drawn, as before this PR. ## Tests - `first_person` tests: 13 pass, including `a_map_is_two_handed_only_in_the_main_hand_with_an_empty_off_hand` and `one_handed_maps_follow_render_one_handed_map` (these are new; main has no one-handed case). - In game (Mac mini, Metal, offscreen 1280x720), in-frame and `--server-thread`: | before (main) | after | |---|---| | ![](https://raw.githubusercontent.com/ludovic111/horizon/c5d43f6e724a6e9c6ad44ed4b6fc33fcfa081392/1459/map-offhand-before.png) | ![](https://raw.githubusercontent.com/ludovic111/horizon/c5d43f6e724a6e9c6ad44ed4b6fc33fcfa081392/1459/map-offhand-after.png) | | ![](https://raw.githubusercontent.com/ludovic111/horizon/c5d43f6e724a6e9c6ad44ed4b6fc33fcfa081392/1459/map-main-offitem-before.png) | ![](https://raw.githubusercontent.com/ludovic111/horizon/c5d43f6e724a6e9c6ad44ed4b6fc33fcfa081392/1459/map-main-offitem-after.png) | All four cases after the change (two-handed, main hand with a torch in the off hand, off hand only, a map in both hands): ![](https://raw.githubusercontent.com/ludovic111/horizon/c5d43f6e724a6e9c6ad44ed4b6fc33fcfa081392/1459/maps-after-grid.png) The off-hand map on `--server-thread`: ![](https://raw.githubusercontent.com/ludovic111/horizon/c5d43f6e724a6e9c6ad44ed4b6fc33fcfa081392/1459/map-offhand-after-st.png) I couldn't capture the vanilla client next to these: the Mac mini session is locked, so only Horizon's own offscreen screenshots work. The pose is checked numerically against vanilla's `PoseStack` instead. ## Self-check These checks ran on one integration commit with #1467, #1468, #1469, #1470 and #1471 merged on main (Mac mini): - `cargo fmt --all -- --check`: clean - `cargo clippy --workspace --all-targets -- -D warnings`: clean. The first run was on main at 8a4ebcc55, with the two functions #1472 restores added in a local commit. The final run, on main with #1472 merged, is clean too. - `cargo test -p horizon-client --lib`: 1063 passed. `--bins`: 98 + 18 passed. - `tools/parity.py --changed origin/main`: 309/310 passed in 69.8 min, the same run as the clippy check above. The one failure, `menu_click`, was the loom case fixed in #1467's second commit. On the refreshed integration commit (main with #1472, plus all five branches), `menu_click` passes: 8000/8000 with seed 7 and with seed 11. ## Needs Ludovic Nothing. 🤖 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 04:10:19 +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#3546
No description provided.