[PR #4005] [MERGED] Cushions swing the arm when placed and let a seated player change seats #5349

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

📋 Pull Request Information

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

Base: main ← Head: fix-3117


📝 Commits (2)

  • 682f8a2 Cushions swing the arm when placed and let a seated player change seats
  • b80c1a9 lan_e2e: cushions check covers the placing swing and changing seats

📊 Changes

4 files changed (+96 additions, -44 deletions)

View changed files

📝 crates/horizon-client/src/game/consume.rs (+2 -0)
📝 crates/horizon-client/src/game/cushions.rs (+55 -41)
📝 crates/horizon-client/src/game/remote.rs (+10 -0)
📝 tools/lan_e2e.py (+29 -3)

📄 Description

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

What and why

Two things were wrong with cushions:

  • Placing one didn't swing the arm. CushionItem.useOn returns SUCCESS, which swings the hand, but place_cushion never called swing_arm. A client of a server (a LAN guest, and the single player window on its server thread) didn't predict that SUCCESS either, so it didn't swing there. The checks up to Cushion.canBePlacedAt now live in cushion_spawn. place_cushion uses it and then swings. predict_item_on_block uses it for a held cushion, the way the vanilla client's useOn returns SUCCESS before the server spawns the cushion.
  • A seated player couldn't move to another cushion. interact_cushion passed whenever the player already rode something. The comment said the client never sends that click, but it does: LocalPlayer.handsBusy is only set in a boat. Cushion.interact sits the player down through Entity.startRiding, which first calls stopRiding on the current vehicle. interact_cushion now calls stop_riding before sitting. stop_riding gets a cushion branch (LivingEntity.stopRiding: the rider goes beside the cushion, and Cushion.removePassenger plays the get-up sound). Getting up on sneak uses the same code.

Fixes #3117

Kind

  • parity: Horizon now does what vanilla 26.3 does
  • bug: a crash or a breakage
  • perf: faster, or less memory
  • feature: something new for players (listed under New in the release notes)
  • extra: Horizon-only, off by default
  • tooling: tools, CI, tests, harnesses
  • docs

Vanilla reference

  • CushionItem.useOn: returns FAIL off the top face or when Cushion.canBePlacedAt fails. On a client level it returns SUCCESS without the ServerLevel branch (entity check, spawn, consume), and the hand swings.
  • Cushion.interact: PASS on secondary use or when isVehicle. Otherwise Player.startRiding(this) → Entity.startRiding(Entity, boolean, boolean), which calls stopRiding() when isPassenger(), then CUSHION_SIT.
  • Cushion.removePassenger: CUSHION_GET_UP unless the cushion was removed.
  • LocalPlayer.rideTick: handsBusy is only set for an AbstractBoat, so Minecraft.startUseItem sends the click while the player sits on a cushion.

The test is tools/lan_e2e.py --check cushions, which now asserts, for both the host (server thread) and the LAN guest:

  • placing a cushion starts one swing (state.swings);
  • a player on one cushion who right-clicks a second ends up riding the second.

tools/test_cushion_placement_parity.py still matches vanilla (the placement checks only moved into cushion_spawn).

Self-check

tools/pr_ready.py doesn't run on Windows, so I ran the checks one by one. lan_e2e.py needs symlinks and vscreen, so a small local wrapper ran it unchanged, with junctions in place of the symlinks.

  • cargo fmt --all -- --check: clean
  • cargo clippy -p horizon-client --all-targets -- -D warnings: clean
  • cargo test -p horizon-client --lib cushion: 1 passed
  • cargo test -p horizon-client --bin horizon-client -- cushion riding remote::: 7 passed
  • python tools/test_cushion_placement_parity.py: 2,852 cases match the pinned client
  • python tools/lan_e2e.py --check cushions (server thread):
    • with the code change reverted: FAIL, 'place_swings': 0. With the swing assert skipped, so the run reaches the seat switch: FAIL, 'riding': 533, 'switched': 533 (still on the first cushion).
    • with the fix: PASS. Host: 'place_swings': 1, 'riding': 501, 'switched': 502. Guest: 'place_swings': 1, 'riding': 504, 'switched': 505. Break particles are still 10 on both sides.

Screenshots

Placing a cushion now swings the arm, for the host and for a LAN guest. A player sitting on a cushion who right-clicks another one moves onto it: the get-up sound plays at the old cushion and the sit sound at the new one. Before, only the arm swung and the player stayed on the first cushion.

🤖 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/4005 **Author:** [@d3grando](https://github.com/d3grando) **Created:** 10/29/2026 **Status:** ✅ Merged **Merged:** 10/30/2026 **Merged by:** [@levzzz5154](https://github.com/levzzz5154) **Base:** `main` ← **Head:** `fix-3117` --- ### 📝 Commits (2) - [`682f8a2`](https://github.com/horizon-rust/horizon/commit/682f8a20fab6dba889ebe28cde19fffe55deef64) Cushions swing the arm when placed and let a seated player change seats - [`b80c1a9`](https://github.com/horizon-rust/horizon/commit/b80c1a9eefb912a07df6a85c15865a9bcea7ae3a) lan_e2e: cushions check covers the placing swing and changing seats ### 📊 Changes **4 files changed** (+96 additions, -44 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/consume.rs` (+2 -0) 📝 `crates/horizon-client/src/game/cushions.rs` (+55 -41) 📝 `crates/horizon-client/src/game/remote.rs` (+10 -0) 📝 `tools/lan_e2e.py` (+29 -3) </details> ### 📄 Description > 🤖 Opened by d3grando's AI agent (Claude Code, Claude Opus 5.5), not by d3grando personally. ## What and why Two things were wrong with cushions: - **Placing one didn't swing the arm.** `CushionItem.useOn` returns `SUCCESS`, which swings the hand, but `place_cushion` never called `swing_arm`. A client of a server (a LAN guest, and the single player window on its server thread) didn't predict that `SUCCESS` either, so it didn't swing there. The checks up to `Cushion.canBePlacedAt` now live in `cushion_spawn`. `place_cushion` uses it and then swings. `predict_item_on_block` uses it for a held cushion, the way the vanilla client's `useOn` returns `SUCCESS` before the server spawns the cushion. - **A seated player couldn't move to another cushion.** `interact_cushion` passed whenever the player already rode something. The comment said the client never sends that click, but it does: `LocalPlayer.handsBusy` is only set in a boat. `Cushion.interact` sits the player down through `Entity.startRiding`, which first calls `stopRiding` on the current vehicle. `interact_cushion` now calls `stop_riding` before sitting. `stop_riding` gets a cushion branch (`LivingEntity.stopRiding`: the rider goes beside the cushion, and `Cushion.removePassenger` plays the get-up sound). Getting up on sneak uses the same code. Fixes #3117 ## Kind - [x] parity: Horizon now does what vanilla 26.3 does - [ ] bug: a crash or a breakage - [ ] perf: faster, or less memory - [ ] feature: something new for players (listed under New in the release notes) - [ ] extra: Horizon-only, off by default - [ ] tooling: tools, CI, tests, harnesses - [ ] docs ## Vanilla reference - `CushionItem.useOn`: returns `FAIL` off the top face or when `Cushion.canBePlacedAt` fails. On a client level it returns `SUCCESS` without the `ServerLevel` branch (entity check, spawn, consume), and the hand swings. - `Cushion.interact`: `PASS` on secondary use or when `isVehicle`. Otherwise `Player.startRiding(this)` → `Entity.startRiding(Entity, boolean, boolean)`, which calls `stopRiding()` when `isPassenger()`, then `CUSHION_SIT`. - `Cushion.removePassenger`: `CUSHION_GET_UP` unless the cushion was removed. - `LocalPlayer.rideTick`: `handsBusy` is only set for an `AbstractBoat`, so `Minecraft.startUseItem` sends the click while the player sits on a cushion. The test is `tools/lan_e2e.py --check cushions`, which now asserts, for both the host (server thread) and the LAN guest: - placing a cushion starts one swing (`state.swings`); - a player on one cushion who right-clicks a second ends up riding the second. `tools/test_cushion_placement_parity.py` still matches vanilla (the placement checks only moved into `cushion_spawn`). ## Self-check `tools/pr_ready.py` doesn't run on Windows, so I ran the checks one by one. `lan_e2e.py` needs symlinks and vscreen, so a small local wrapper ran it unchanged, with junctions in place of the symlinks. - `cargo fmt --all -- --check`: clean - `cargo clippy -p horizon-client --all-targets -- -D warnings`: clean - `cargo test -p horizon-client --lib cushion`: 1 passed - `cargo test -p horizon-client --bin horizon-client -- cushion riding remote::`: 7 passed - `python tools/test_cushion_placement_parity.py`: 2,852 cases match the pinned client - `python tools/lan_e2e.py --check cushions` (server thread): - with the code change reverted: **FAIL**, `'place_swings': 0`. With the swing assert skipped, so the run reaches the seat switch: **FAIL**, `'riding': 533, 'switched': 533` (still on the first cushion). - with the fix: **PASS**. Host: `'place_swings': 1, 'riding': 501, 'switched': 502`. Guest: `'place_swings': 1, 'riding': 504, 'switched': 505`. Break particles are still 10 on both sides. ## Screenshots Placing a cushion now swings the arm, for the host and for a LAN guest. A player sitting on a cushion who right-clicks another one moves onto it: the get-up sound plays at the old cushion and the sit sound at the new one. Before, only the arm swung and the player stayed on the first cushion. 🤖 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:11:58 +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#5349
No description provided.