[PR #4730] [MERGED] Fix inverted day/night on multiplayer servers #5811

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/4730
Author: @WooCaash
Created: 10/30/2026
Status: ✅ Merged
Merged: 10/31/2026
Merged by: @rdbtCVS

Base: main ← Head: fix/4714-server-day-night


📝 Commits (2)

  • e5f3507 Fix server day/night by applying only the level's world clock
  • 230ae97 Format SetTime clock picker for rustfmt

📊 Changes

2 files changed (+56 additions, -12 deletions)

View changed files

📝 crates/horizon-client/src/game/remote.rs (+16 -8)
📝 crates/horizon-protocol/src/registry.rs (+40 -4)

📄 Description

🤖 Opened by WooCaash's AI agent (Cursor), not by WooCaash personally.

Summary

  • ClientboundSetTimePacket can update a single world clock (e.g. the End's). Horizon fell back to clocks.first() when the packet's clock was not this level's, so an overworld client could adopt the End clock's total_ticks (tied to game_time) as day_time.
  • That desyncs the sky from the server's overworld day clock: night visuals while the server still says day (beds refuse sleep). Matches #4714 on CherryCraft.
  • Apply only the dimension's default_clock (parsed on DimensionType), or the clock id already tracked for this level — never a random other clock.

Fixes #4714

Test plan

  • cargo test -p horizon-protocol --lib registry::tests
  • Join a 26.3 server (or LAN host) in the overworld: sky matches /time query daytime / bed sleep rules
  • After visiting the End (or while End clock updates fire), overworld day/night stays correct
  • /time set night / day on the server still updates the client sky

🤖 Generated with Cursor

Made with Cursor


🔄 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/4730 **Author:** [@WooCaash](https://github.com/WooCaash) **Created:** 10/30/2026 **Status:** ✅ Merged **Merged:** 10/31/2026 **Merged by:** [@rdbtCVS](https://github.com/rdbtCVS) **Base:** `main` ← **Head:** `fix/4714-server-day-night` --- ### 📝 Commits (2) - [`e5f3507`](https://github.com/horizon-rust/horizon/commit/e5f3507585284a01b1a5e03ca8ca263cbbae0ff3) Fix server day/night by applying only the level's world clock - [`230ae97`](https://github.com/horizon-rust/horizon/commit/230ae976e1e7600d1f7f69ed581f15ed9cae2e19) Format SetTime clock picker for rustfmt ### 📊 Changes **2 files changed** (+56 additions, -12 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/remote.rs` (+16 -8) 📝 `crates/horizon-protocol/src/registry.rs` (+40 -4) </details> ### 📄 Description > 🤖 Opened by WooCaash's AI agent (Cursor), not by WooCaash personally. ## Summary - `ClientboundSetTimePacket` can update a single world clock (e.g. the End's). Horizon fell back to `clocks.first()` when the packet's clock was not this level's, so an overworld client could adopt the End clock's `total_ticks` (tied to `game_time`) as `day_time`. - That desyncs the sky from the server's overworld day clock: night visuals while the server still says day (beds refuse sleep). Matches #4714 on CherryCraft. - Apply only the dimension's `default_clock` (parsed on `DimensionType`), or the clock id already tracked for this level — never a random other clock. Fixes #4714 ## Test plan - [ ] `cargo test -p horizon-protocol --lib registry::tests` - [ ] Join a 26.3 server (or LAN host) in the overworld: sky matches `/time query daytime` / bed sleep rules - [ ] After visiting the End (or while End clock updates fire), overworld day/night stays correct - [ ] `/time set night` / `day` on the server still updates the client sky 🤖 Generated with [Cursor](https://cursor.com) Made with [Cursor](https://cursor.com) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 05:15:10 +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#5811
No description provided.