[PR #2525] [MERGED] Size players' boxes by pose, including sleeping #4396

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/2525
Author: @kacpherek
Created: 10/26/2026
Status: ✅ Merged
Merged: 10/27/2026
Merged by: @ludovic111

Base: main ← Head: fix/player-pose-dimensions


📝 Commits (2)

  • 9dd6933 Size players' boxes by pose, including sleeping
  • 9c3058f Merge main into fix/player-pose-dimensions

📊 Changes

14 files changed (+130 additions, -46 deletions)

View changed files

📝 crates/horizon-client/src/game.rs (+4 -1)
📝 crates/horizon-client/src/game/lan.rs (+1 -0)
📝 crates/horizon-client/src/game/lan_actions.rs (+3 -3)
📝 crates/horizon-client/src/game/lan_mobs.rs (+6 -11)
📝 crates/horizon-client/src/game/minecarts.rs (+1 -6)
📝 crates/horizon-client/src/game/remote.rs (+1 -1)
📝 crates/horizon-client/src/game/remote_mob_data.rs (+6 -0)
📝 crates/horizon-client/src/lan/guest.rs (+40 -2)
📝 crates/horizon-client/src/lan/hub.rs (+2 -12)
📝 crates/horizon-client/src/mobs.rs (+3 -0)
📝 crates/horizon-client/src/mobs/living.rs (+9 -0)
📝 crates/horizon-client/src/mobs/render.rs (+8 -1)
📝 crates/horizon-client/src/motion.rs (+3 -0)
📝 crates/horizon-client/src/pose.rs (+43 -9)

📄 Description

What and why

A player's box now follows the pose, the same way for the local player, other players on a server and LAN guests.

  • Added the sleeping pose (0.2 x 0.2, eye 0.2) to pose.rs. The local player and LAN guests take it in bed, so block placement beside a sleeping player is no longer blocked by a 1.8 tall box.
  • Other players and mannequins read the synced pose (Entity.DATA_POSE), so swimming, gliding, spin attack, crouching and sleeping change their box and eye height. Before, a crouching server player kept the 1.8 box.
  • LAN guests use one function for their box and eye height (Guest::dimensions) instead of the "1.5 if sneaking else 1.8" rule that was repeated in several places. It also drops the sneak size while flying, like Player.getDesiredPose.
  • The LAN host now tells guests when another guest is swimming (pose 3).
  • A lying player is still drawn with the standing eye height for the head offset, as vanilla's renderer does.

Vanilla reference

  • Avatar.POSES, LivingEntity.SLEEPING_DIMENSIONS, LivingEntity.getDimensions
  • Player.getDesiredPose, LivingEntity.startSleeping / stopSleeping
  • LivingEntityRenderer (bed head offset uses getEyeHeight(Pose.STANDING))

Self-check

cargo check -p horizon-client passes.


🔄 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/2525 **Author:** [@kacpherek](https://github.com/kacpherek) **Created:** 10/26/2026 **Status:** ✅ Merged **Merged:** 10/27/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/player-pose-dimensions` --- ### 📝 Commits (2) - [`9dd6933`](https://github.com/horizon-rust/horizon/commit/9dd6933dab52997b13902e41b79802e9cbda23f5) Size players' boxes by pose, including sleeping - [`9c3058f`](https://github.com/horizon-rust/horizon/commit/9c3058f7568f149c649b14688dd525d698a78622) Merge main into fix/player-pose-dimensions ### 📊 Changes **14 files changed** (+130 additions, -46 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game.rs` (+4 -1) 📝 `crates/horizon-client/src/game/lan.rs` (+1 -0) 📝 `crates/horizon-client/src/game/lan_actions.rs` (+3 -3) 📝 `crates/horizon-client/src/game/lan_mobs.rs` (+6 -11) 📝 `crates/horizon-client/src/game/minecarts.rs` (+1 -6) 📝 `crates/horizon-client/src/game/remote.rs` (+1 -1) 📝 `crates/horizon-client/src/game/remote_mob_data.rs` (+6 -0) 📝 `crates/horizon-client/src/lan/guest.rs` (+40 -2) 📝 `crates/horizon-client/src/lan/hub.rs` (+2 -12) 📝 `crates/horizon-client/src/mobs.rs` (+3 -0) 📝 `crates/horizon-client/src/mobs/living.rs` (+9 -0) 📝 `crates/horizon-client/src/mobs/render.rs` (+8 -1) 📝 `crates/horizon-client/src/motion.rs` (+3 -0) 📝 `crates/horizon-client/src/pose.rs` (+43 -9) </details> ### 📄 Description ## What and why A player's box now follows the pose, the same way for the local player, other players on a server and LAN guests. - Added the sleeping pose (0.2 x 0.2, eye 0.2) to `pose.rs`. The local player and LAN guests take it in bed, so block placement beside a sleeping player is no longer blocked by a 1.8 tall box. - Other players and mannequins read the synced pose (`Entity.DATA_POSE`), so swimming, gliding, spin attack, crouching and sleeping change their box and eye height. Before, a crouching server player kept the 1.8 box. - LAN guests use one function for their box and eye height (`Guest::dimensions`) instead of the "1.5 if sneaking else 1.8" rule that was repeated in several places. It also drops the sneak size while flying, like `Player.getDesiredPose`. - The LAN host now tells guests when another guest is swimming (pose 3). - A lying player is still drawn with the standing eye height for the head offset, as vanilla's renderer does. ## Vanilla reference - `Avatar.POSES`, `LivingEntity.SLEEPING_DIMENSIONS`, `LivingEntity.getDimensions` - `Player.getDesiredPose`, `LivingEntity.startSleeping` / `stopSleeping` - `LivingEntityRenderer` (bed head offset uses `getEyeHeight(Pose.STANDING)`) ## Self-check `cargo check -p horizon-client` passes. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 04:16:52 +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#4396
No description provided.