[PR #1248] [MERGED] Fix hand animation for rejected block placements #3454

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/1248
Author: @rdbtCVS
Created: 10/22/2026
Status: ✅ Merged
Merged: 10/22/2026
Merged by: @ludovic111

Base: main ← Head: t3/fix-block-place-animation


📝 Commits (1)

  • ecbb036 Fix hand swing prediction for rejected block placements

📊 Changes

4 files changed (+222 additions, -27 deletions)

View changed files

📝 crates/horizon-client/src/game/remote.rs (+196 -24)
📝 crates/horizon-world/examples/level_place_fixture.rs (+5 -0)
📝 mods/horizon/src/test/java/dev/horizonlab/parity/VanillaBlockPlacementOracle.java (+4 -2)
📝 tools/test_level_place_parity.py (+17 -1)

📄 Description

What and why

The multiplayer client swung its hand whenever the held item was a block, including when an entity or player prevented placement. Preview BlockItem.place against the client level and predict the swing only when placement succeeds or the clicked block consumes the interaction. A rejected placement still ends the click, as vanilla's FAIL result does.

The preview reuses the existing placement and entity-obstruction rules. It keeps block writes, events, scheduled ticks and random draws separate from the live level.

Vanilla reference

Read with tools/rea_vanilla.py: Minecraft.startUseItem, BlockItem.place, and BlockItem.canPlace. Vanilla swings only for a successful predicted interaction; entity obstruction makes block placement fail.

Extended tools/test_level_place_parity.py and its Java oracle/Rust probe with obstruction cases for stone, slabs, stairs, doors and torches. Added a client regression test covering accepted placement, obstruction, unloaded chunks, build height, and preview isolation, including a placement that draws a random age.

Self-check

pr_ready (tools/pr_ready.py --quick on archlinux, against origin/main at 022600481, 12 min 54 s)

Check Result
Scope ✅ 4 files, +220 −27
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 290 passed (36 s)
rustfmt ✅ (11 s)
clippy ✅ (4 min 52 s)
tests: horizon-client, horizon-world ✅ 1338 passed (7 min 3 s)
doc tests ✅ 0 passed (6 s)
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ➖ 265 affected, to run in CI (--quick): ambient_sound, arrow, attribute_health, attribute_map_queries, attribute, attribute_updates, audio_attributes, auto_jump, bamboo, basic_feature, biome_chunk, biome_generation and 253 more
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

Targeted vanilla harnesses also passed directly:

  • Block placement: 20,010/20,010 cases match vanilla, including the new obstruction cases.
  • First-person hands: 4,194 cases / 382,070 output lines match vanilla.
  • Interaction input: 392 cases / 1,484 output lines match vanilla.
  • Entity obstruction: 15,121 output lines match each of the vanilla client and server.
  • The client placement-preview regression passed with prepared game resources.

The full parity selector was stopped after it selected 265 harnesses without recorded dependency history in this checkout. The four relevant harnesses above were run directly; the standard self-check used --quick.


🔄 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/1248 **Author:** [@rdbtCVS](https://github.com/rdbtCVS) **Created:** 10/22/2026 **Status:** ✅ Merged **Merged:** 10/22/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `t3/fix-block-place-animation` --- ### 📝 Commits (1) - [`ecbb036`](https://github.com/horizon-rust/horizon/commit/ecbb0368c551b060fb6c13766552062c9508d487) Fix hand swing prediction for rejected block placements ### 📊 Changes **4 files changed** (+222 additions, -27 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/remote.rs` (+196 -24) 📝 `crates/horizon-world/examples/level_place_fixture.rs` (+5 -0) 📝 `mods/horizon/src/test/java/dev/horizonlab/parity/VanillaBlockPlacementOracle.java` (+4 -2) 📝 `tools/test_level_place_parity.py` (+17 -1) </details> ### 📄 Description ## What and why The multiplayer client swung its hand whenever the held item was a block, including when an entity or player prevented placement. Preview `BlockItem.place` against the client level and predict the swing only when placement succeeds or the clicked block consumes the interaction. A rejected placement still ends the click, as vanilla's `FAIL` result does. The preview reuses the existing placement and entity-obstruction rules. It keeps block writes, events, scheduled ticks and random draws separate from the live level. ## Vanilla reference Read with `tools/rea_vanilla.py`: `Minecraft.startUseItem`, `BlockItem.place`, and `BlockItem.canPlace`. Vanilla swings only for a successful predicted interaction; entity obstruction makes block placement fail. Extended `tools/test_level_place_parity.py` and its Java oracle/Rust probe with obstruction cases for stone, slabs, stairs, doors and torches. Added a client regression test covering accepted placement, obstruction, unloaded chunks, build height, and preview isolation, including a placement that draws a random age. ## Self-check **pr_ready** (`tools/pr_ready.py --quick` on archlinux, against origin/main at 022600481, 12 min 54 s) | Check | Result | | --- | --- | | Scope | ✅ 4 files, +220 −27 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 290 passed (36 s) | | rustfmt | ✅ (11 s) | | clippy | ✅ (4 min 52 s) | | tests: horizon-client, horizon-world | ✅ 1338 passed (7 min 3 s) | | doc tests | ✅ 0 passed (6 s) | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ➖ 265 affected, to run in CI (--quick): ambient_sound, arrow, attribute_health, attribute_map_queries, attribute, attribute_updates, audio_attributes, auto_jump, bamboo, basic_feature, biome_chunk, biome_generation and 253 more | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | Targeted vanilla harnesses also passed directly: - Block placement: 20,010/20,010 cases match vanilla, including the new obstruction cases. - First-person hands: 4,194 cases / 382,070 output lines match vanilla. - Interaction input: 392 cases / 1,484 output lines match vanilla. - Entity obstruction: 15,121 output lines match each of the vanilla client and server. - The client placement-preview regression passed with prepared game resources. The full parity selector was stopped after it selected 265 harnesses without recorded dependency history in this checkout. The four relevant harnesses above were run directly; the standard self-check used `--quick`. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 04:09:38 +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#3454
No description provided.