[PR #2429] [MERGED] Send swimming, gliding, fire, invisible and glowing for LAN players #4306

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

📋 Pull Request Information

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

Base: main ← Head: fix/lan-player-pose-flags


📝 Commits (2)

  • 9e84867 Send swimming, gliding, fire, invisible and glowing for LAN players
  • 9eb913a Show the crouching pose of a guest who is not holding sneak

📊 Changes

3 files changed (+83 additions, -12 deletions)

View changed files

📝 crates/horizon-client/src/game/lan.rs (+11 -1)
📝 crates/horizon-client/src/lan/hub.rs (+71 -11)
📝 crates/horizon-client/tests/lan_bot.rs (+1 -0)

📄 Description

What and why

The shared entity flags and the pose Horizon sent for a player on a LAN world were incomplete:

  • The host's gliding was hard-coded to off, so guests never saw the host with elytra.
  • Nobody was sent the swimming flag or the swimming pose, so a swimming or crawling player stayed in the standing pose for the others. Riptide's spin pose was missing too.
  • The on fire, invisible and glowing flags were never sent for players, so a burning, invisible or glowing player looked normal.

The host state now carries these (from the player's gliding, swimming, pose, fire ticks and effects) and guests' are read from their server-side body and effects. The shared flags byte gets 0x01, 0x10, 0x20, 0x40 and 0x80, and the pose follows Player.getDesiredPose: sleeping, swimming, gliding, spin attack, crouching. The lan_bot test only needed the new HostState field filled in.

Vanilla reference

  • Entity shared flags: FLAG_ONFIRE 0, FLAG_SHIFT_KEY_DOWN 1, FLAG_SPRINTING 3, FLAG_SWIMMING 4, FLAG_INVISIBLE 5, FLAG_GLOWING 6, FLAG_FALL_FLYING 7.
  • Player.getDesiredPose and Player.updatePlayerPose (the crawl fallback), Pose ids.
  • LivingEntity.updateInvisibilityStatus, updateGlowingStatus and isCurrentlyGlowing (invisibility and glowing effects).
  • Entity.setSharedFlagOnFire (fire ticks above zero).

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/2429 **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/lan-player-pose-flags` --- ### 📝 Commits (2) - [`9e84867`](https://github.com/horizon-rust/horizon/commit/9e848670dbb543e2e0338b0290804390fd6cd577) Send swimming, gliding, fire, invisible and glowing for LAN players - [`9eb913a`](https://github.com/horizon-rust/horizon/commit/9eb913affea478d58d127e08f39fcacf379103f0) Show the crouching pose of a guest who is not holding sneak ### 📊 Changes **3 files changed** (+83 additions, -12 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/lan.rs` (+11 -1) 📝 `crates/horizon-client/src/lan/hub.rs` (+71 -11) 📝 `crates/horizon-client/tests/lan_bot.rs` (+1 -0) </details> ### 📄 Description ## What and why The shared entity flags and the pose Horizon sent for a player on a LAN world were incomplete: - The host's gliding was hard-coded to off, so guests never saw the host with elytra. - Nobody was sent the swimming flag or the swimming pose, so a swimming or crawling player stayed in the standing pose for the others. Riptide's spin pose was missing too. - The on fire, invisible and glowing flags were never sent for players, so a burning, invisible or glowing player looked normal. The host state now carries these (from the player's gliding, swimming, pose, fire ticks and effects) and guests' are read from their server-side body and effects. The shared flags byte gets 0x01, 0x10, 0x20, 0x40 and 0x80, and the pose follows `Player.getDesiredPose`: sleeping, swimming, gliding, spin attack, crouching. The `lan_bot` test only needed the new `HostState` field filled in. ## Vanilla reference - `Entity` shared flags: `FLAG_ONFIRE` 0, `FLAG_SHIFT_KEY_DOWN` 1, `FLAG_SPRINTING` 3, `FLAG_SWIMMING` 4, `FLAG_INVISIBLE` 5, `FLAG_GLOWING` 6, `FLAG_FALL_FLYING` 7. - `Player.getDesiredPose` and `Player.updatePlayerPose` (the crawl fallback), `Pose` ids. - `LivingEntity.updateInvisibilityStatus`, `updateGlowingStatus` and `isCurrentlyGlowing` (invisibility and glowing effects). - `Entity.setSharedFlagOnFire` (fire ticks above zero). ## 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:13 +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#4306
No description provided.