[PR #4044] [MERGED] Armor stands: placing one swings the hand, as vanilla does #5375

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

📋 Pull Request Information

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

Base: main ← Head: fix/armor-stand-swing


📝 Commits (1)

  • fdc7593 Armor stands: placing one swings the hand, as vanilla does

📊 Changes

2 files changed (+30 additions, -3 deletions)

View changed files

📝 crates/horizon-client/src/game/armor_stands.rs (+18 -3)
📝 crates/horizon-client/src/game/remote.rs (+12 -0)

📄 Description

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

What

Placing an armor stand now swings the hand, like placing a block.

Fixes #4024

Why

ArmorStandItem.useOn (26.3 jar, javap):

  • returns FAIL on a bottom face;
  • returns FAIL when level.noCollision(box) fails or level.getEntities(null, box) isn't empty;
  • otherwise shrinks the stack and returns SUCCESS, also on a client level.

SUCCESS swings the hand. Horizon's placement (place_armor_stand) never swung. On a server's client the use fell through to the generic paths, which don't swing for this item.

Fix

  • The shared checks (bottom face, block collisions, other stands in the box) move into armor_stand_spawn.
  • place_armor_stand swings after placing.
  • remote_use_item_on runs the same check before UseItemOn goes out (vanilla's startPrediction runs useOn before it builds the packet). When the check holds, the hand swings and the click ends, as for the other Item.useOn successes.
  • The check runs before sending because in single player the integrated server can spawn the stand while the packet is handled. A check after the send then finds the new stand in the way.
  • This doesn't touch predict_item_on_block, which #4005 changes for cushions.

Checked

  • In game, fast build with a scratch home and horizon-ctl (look-at, mouse right click on the floor with an armor stand in hand): the stand is placed, before and after.
  • Not measured: the swing itself. horizon-ctl state's swings counter stays at 0 in this single-player setup even when placing stone, so it can't show the swing here. tools/lan_e2e.py (host plus guest), where #4005 checks its cushion swing this way, doesn't run on Windows.
  • pr_ready failures not caused by this change:
    • the axolotl NBT test also fails on main (#3840, fixed by #3851);
    • title::tests::each_world_preset_writes_its_own_generator fails on Windows with os error 267 (NotADirectory);
    • the clippy failure comes from lints new in clippy 1.96, in code this PR doesn't touch;
    • Parity can't start on Windows (fcntl).

pr_ready (tools/pr_ready.py --base upstream/main on DenisPC, against upstream/main at 7f54b8abb, 3 min 3 s)

Check Result
Scope ✅ 3 files, +31 −3
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 475 passed (53 s)
rustfmt ✅ (6 s)
clippy ❌ failed (12 s)
tests: horizon-client ❌ 686 passed, 2 failed (1 min 47 s)
doc tests ✅ 0 passed (1 s)
content root tests ➖ content root untouched
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ❌ 362 affected, (1 s)
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

🤖 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/4044 **Author:** [@DenisHumen](https://github.com/DenisHumen) **Created:** 10/29/2026 **Status:** ✅ Merged **Merged:** 10/29/2026 **Merged by:** [@levzzz5154](https://github.com/levzzz5154) **Base:** `main` ← **Head:** `fix/armor-stand-swing` --- ### 📝 Commits (1) - [`fdc7593`](https://github.com/horizon-rust/horizon/commit/fdc75931807f045b91b91bde32c2460bea5536ed) Armor stands: placing one swings the hand, as vanilla does ### 📊 Changes **2 files changed** (+30 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/armor_stands.rs` (+18 -3) 📝 `crates/horizon-client/src/game/remote.rs` (+12 -0) </details> ### 📄 Description > 🤖 Opened by DenisHumen's AI agent (Claude Code, Opus 5.5), not by DenisHumen personally. ## What Placing an armor stand now swings the hand, like placing a block. Fixes #4024 ## Why `ArmorStandItem.useOn` (26.3 jar, `javap`): - returns `FAIL` on a bottom face; - returns `FAIL` when `level.noCollision(box)` fails or `level.getEntities(null, box)` isn't empty; - otherwise shrinks the stack and returns `SUCCESS`, also on a client level. `SUCCESS` swings the hand. Horizon's placement (`place_armor_stand`) never swung. On a server's client the use fell through to the generic paths, which don't swing for this item. ## Fix - The shared checks (bottom face, block collisions, other stands in the box) move into `armor_stand_spawn`. - `place_armor_stand` swings after placing. - `remote_use_item_on` runs the same check before `UseItemOn` goes out (vanilla's `startPrediction` runs `useOn` before it builds the packet). When the check holds, the hand swings and the click ends, as for the other `Item.useOn` successes. - The check runs before sending because in single player the integrated server can spawn the stand while the packet is handled. A check after the send then finds the new stand in the way. - This doesn't touch `predict_item_on_block`, which #4005 changes for cushions. ## Checked - In game, fast build with a scratch home and `horizon-ctl` (`look-at`, `mouse right click` on the floor with an armor stand in hand): the stand is placed, before and after. - **Not measured: the swing itself.** `horizon-ctl state`'s `swings` counter stays at 0 in this single-player setup even when placing stone, so it can't show the swing here. `tools/lan_e2e.py` (host plus guest), where #4005 checks its cushion swing this way, doesn't run on Windows. - pr_ready failures not caused by this change: - the axolotl NBT test also fails on `main` (#3840, fixed by #3851); - `title::tests::each_world_preset_writes_its_own_generator` fails on Windows with os error 267 (`NotADirectory`); - the clippy failure comes from lints new in clippy 1.96, in code this PR doesn't touch; - Parity can't start on Windows (`fcntl`). **pr_ready** (`tools/pr_ready.py --base upstream/main` on DenisPC, against upstream/main at 7f54b8abb, 3 min 3 s) | Check | Result | | --- | --- | | Scope | ✅ 3 files, +31 −3 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 475 passed (53 s) | | rustfmt | ✅ (6 s) | | clippy | ❌ failed (12 s) | | tests: horizon-client | ❌ 686 passed, 2 failed (1 min 47 s) | | doc tests | ✅ 0 passed (1 s) | | content root tests | ➖ content root untouched | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ❌ 362 affected, (1 s) | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | 🤖 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:12:10 +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#5375
No description provided.