[PR #6915] [MERGED] Keep a dropped item's move a delta when only its data changed #7190

Closed
opened 2026-11-03 06:35:27 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/6915
Author: @MSedgeMC
Created: 11/2/2026
Status: ✅ Merged
Merged: 11/2/2026
Merged by: @ludovic111

Base: main ← Head: fix/item-not-precise


📝 Commits (1)

  • 247d5d4 Keep a dropped item's move a delta when only its data changed

📊 Changes

2 files changed (+21 additions, -1 deletions)

View changed files

📝 crates/horizon-client/src/game/lan.rs (+4 -1)
📝 crates/horizon-client/src/lan/entity.rs (+17 -0)

📄 Description

ServerEntity.createMovePacket sends ClientboundEntityPositionSyncPacket when the entity
requires a precise position. Vanilla only makes the entities that ask for it precise
(setRequiresPrecisePosition is called by PrimedTnt, FallingBlock and a still-timeout
HappyGhast); an ItemEntity never does, so a drop whose data has to be sent again still moves
by the 1/4096 delta, except for the collision case that #6882 added.

Horizon copied the item's own needs_sync flag into e.precise, so any drop that asked for its
data again - a velocity jump over 0.1 with no collision, for one - was sent as
EntityPositionSync instead of MoveEntityPos.

Proven: cargo test -q -p horizon-client-lib --lib an_item_that_needs_its_data -> 1 passed:
an item with needs_sync set that moves 0.4 blocks is sent as MoveEntityPos, and the whole
lan::entity module still passes (26 passed), including the item-stopped-by-a-block case that
must stay full precision. cargo clippy -q -p horizon-client-lib --lib silent; rustfmt --edition 2024 --check clean.

Not proven: not watched in game; a LAN guest should see the same item motion with a lighter
packet, and a drop stopped by a block should still land exactly where the host has it.


🔄 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/6915 **Author:** [@MSedgeMC](https://github.com/MSedgeMC) **Created:** 11/2/2026 **Status:** ✅ Merged **Merged:** 11/2/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/item-not-precise` --- ### 📝 Commits (1) - [`247d5d4`](https://github.com/horizon-rust/horizon/commit/247d5d43174645dd5fe38731af376770e045d7a1) Keep a dropped item's move a delta when only its data changed ### 📊 Changes **2 files changed** (+21 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/lan.rs` (+4 -1) 📝 `crates/horizon-client/src/lan/entity.rs` (+17 -0) </details> ### 📄 Description `ServerEntity.createMovePacket` sends `ClientboundEntityPositionSyncPacket` when the entity requires a precise position. Vanilla only makes the entities that ask for it precise (`setRequiresPrecisePosition` is called by `PrimedTnt`, `FallingBlock` and a still-timeout `HappyGhast`); an `ItemEntity` never does, so a drop whose data has to be sent again still moves by the 1/4096 delta, except for the collision case that #6882 added. Horizon copied the item's own `needs_sync` flag into `e.precise`, so any drop that asked for its data again - a velocity jump over 0.1 with no collision, for one - was sent as `EntityPositionSync` instead of `MoveEntityPos`. **Proven:** `cargo test -q -p horizon-client-lib --lib an_item_that_needs_its_data` -> `1 passed`: an item with `needs_sync` set that moves 0.4 blocks is sent as `MoveEntityPos`, and the whole `lan::entity` module still passes (`26 passed`), including the item-stopped-by-a-block case that must stay full precision. `cargo clippy -q -p horizon-client-lib --lib` silent; `rustfmt --edition 2024 --check` clean. **Not proven:** not watched in game; a LAN guest should see the same item motion with a lighter packet, and a drop stopped by a block should still land exactly where the host has it. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 06:35:27 +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#7190
No description provided.