fix: normalize Bedrock entity network offsets - #150
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (8)
🚧 Files skipped from review as they are similar to previous changes (5)
📝 WalkthroughWalkthroughEntity tracking now preserves unique IDs and metadata, applies type-specific network offsets, handles delta movement and metadata acknowledgements, routes new actor packets, removes entities by unique ID, and excludes item entities from combat misprediction targets. ChangesEntity tracking and movement
Combat target filtering
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant Server
participant HandleServerPacket
participant EntityTrackerComponent
participant ClientEntityTracker
Server->>HandleServerPacket: AddActor/AddItemActor/AddPlayer
HandleServerPacket->>EntityTrackerComponent: create entity with adjusted position and UniqueId
Server->>HandleServerPacket: MoveActorDelta
HandleServerPacket->>EntityTrackerComponent: HandleMoveActorDelta(packet)
EntityTrackerComponent->>ClientEntityTracker: enqueue EntityDeltaPosition
ClientEntityTracker->>EntityTrackerComponent: MoveEntityDelta(runtimeID, position, flags)
Server->>HandleServerPacket: RemoveActor(UniqueId)
HandleServerPacket->>EntityTrackerComponent: RemoveEntityByUniqueID(UniqueId)
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
game/movement.go (1)
21-21: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winDocument the precise
1.62001literal.The change from
1.62to1.62001is a protocol-precision fix, but nothing in the code says so. Without a comment, a future cleanup could "round" this back to1.62and silently reintroduce the Y-offset drift this PR fixes.♻️ Suggested comment
- DefaultPlayerHeightOffset = float32(1.62001) + // DefaultPlayerHeightOffset matches the exact Y offset BDS 1.26.30.03 applies + // to standing player positions on the wire; do not round to 1.62. + DefaultPlayerHeightOffset = float32(1.62001)🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@game/movement.go` at line 21, Add a concise comment directly above DefaultPlayerHeightOffset documenting that the precise 1.62001 literal is required for protocol precision and must not be rounded, preserving the current value.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@game/movement.go`:
- Line 21: Add a concise comment directly above DefaultPlayerHeightOffset
documenting that the precise 1.62001 literal is required for protocol precision
and must not be rounded, preserving the current value.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: b31e6260-e1c5-4fea-b34f-0912842d3cc9
📒 Files selected for processing (11)
entity/entity.goentity/network_offset.goentity/network_offset_test.gogame/movement.goplayer/component/acknowledgement/entities.goplayer/component/combat.goplayer/component/entities.goplayer/component/entities_test.goplayer/entities.goplayer/packet.goplayer/packet_entity_offsets_test.go
a27dd7b to
8d34006
Compare
8d34006 to
b45c731
Compare
Summary
Follow-up dependency
The currently pinned Dragonfly still emits its older approximations and raw spawn positions. Its offset implementation must be corrected and the pinned revision updated before this PR merges; otherwise the native Dragonfly integration will subtract mismatched values.
Verification
Summary by CodeRabbit
New Features
Bug Fixes