[PR #6348] [MERGED] The client level unloads when the server sends it back to configuration #6816

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/6348
Author: @breachato
Created: 11/1/2026
Status: ✅ Merged
Merged: 11/1/2026
Merged by: @ludovic111

Base: main ← Head: fix/6317-unload-on-reconfiguration


📝 Commits (1)

  • 8b72830 The client level unloads when the server sends it back to configuration

📊 Changes

1 file changed (+6 additions, -0 deletions)

View changed files

📝 crates/horizon-client/src/game/remote.rs (+6 -0)

📄 Description

🤖 Opened by breachato's AI agent (Claude Code, Claude Opus 5.5), not by breachato personally.

What and why

Fixes #6317.

When a server sends the client back to configuration (a proxy's server switch), vanilla's ClientPacketListener.handleConfigurationStart calls Minecraft.clearClientLevel, which drops the client level then. Horizon's Event::Reconfiguring cleared the level state for the configuration screen but kept heard_level, so native_client_level_unload (#6201) only fired at the next login, after the new level's load, or at a disconnect. A mod kept the old level's state through the configuration screen.

Event::Reconfiguring now takes heard_level and fires the unload, as leave_server does. The next login finds no heard_level, so it fires only the new level's load.

Kind

  • parity: Horizon now does what vanilla 26.3 does
  • bug: a crash or a breakage
  • perf: faster, or less memory
  • feature: something new for players (listed under New in the release notes)
  • extra: Horizon-only, off by default
  • tooling: tools, CI, tests, harnesses
  • docs

Vanilla reference

  • net.minecraft.client.multiplayer.ClientPacketListener.handleConfigurationStart → Minecraft.clearClientLevel.
  • NeoForge's LevelEvent.Unload covers the client clearing its level (as the issue notes).

Not run in game here: a reconfiguration needs a proxy (the issue suggests horizon-machine-sample with both client hooks logged).

Other projects' code

none

Self-check

pr_ready (tools/pr_ready.py --quick --base upstream/main on DESKTOP-G0M27UC, against upstream/main at 62bdd29b2, 11 min 52 s)

Check Result
Scope ✅ 1 files, +6 −0
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 594 passed (3 min 9 s)
rustfmt ✅ (16 s)
clippy ✅ (2 min 58 s)
tests: horizon-client ❌ 559 passed, 1 failed (5 min 19 s)
doc tests ✅ 0 passed (5 s)
content root tests ➖ content root untouched
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ➖ not run (--quick): CI's parity job picks the affected harnesses
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

The one failing test, game::native_hooks::tests::native_loot_kinds_stay_hookable, is unrelated to this change: it reads horizon-world/src/loot.rs with include_str! and looks for " } ", which isn't there on a Windows checkout with core.autocrlf (the file is CRLF there), so find(..).unwrap() panics. It fails the same way on main here; CI (LF) is unaffected.

🤖 Generated with Claude Code


🔄 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/6348 **Author:** [@breachato](https://github.com/breachato) **Created:** 11/1/2026 **Status:** ✅ Merged **Merged:** 11/1/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/6317-unload-on-reconfiguration` --- ### 📝 Commits (1) - [`8b72830`](https://github.com/horizon-rust/horizon/commit/8b728305b175bd2f98ef4e5e29b2381db6163fc4) The client level unloads when the server sends it back to configuration ### 📊 Changes **1 file changed** (+6 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/remote.rs` (+6 -0) </details> ### 📄 Description > 🤖 Opened by breachato's AI agent (Claude Code, Claude Opus 5.5), not by breachato personally. ## What and why Fixes #6317. When a server sends the client back to configuration (a proxy's server switch), vanilla's `ClientPacketListener.handleConfigurationStart` calls `Minecraft.clearClientLevel`, which drops the client level then. Horizon's `Event::Reconfiguring` cleared the level state for the configuration screen but kept `heard_level`, so `native_client_level_unload` (#6201) only fired at the next login, after the new level's load, or at a disconnect. A mod kept the old level's state through the configuration screen. `Event::Reconfiguring` now takes `heard_level` and fires the unload, as `leave_server` does. The next login finds no `heard_level`, so it fires only the new level's load. ## Kind - [ ] parity: Horizon now does what vanilla 26.3 does - [x] bug: a crash or a breakage - [ ] perf: faster, or less memory - [ ] feature: something new for players (listed under New in the release notes) - [ ] extra: Horizon-only, off by default - [ ] tooling: tools, CI, tests, harnesses - [ ] docs ## Vanilla reference - `net.minecraft.client.multiplayer.ClientPacketListener.handleConfigurationStart` → `Minecraft.clearClientLevel`. - NeoForge's `LevelEvent.Unload` covers the client clearing its level (as the issue notes). Not run in game here: a reconfiguration needs a proxy (the issue suggests horizon-machine-sample with both client hooks logged). ## Other projects' code none ## Self-check **pr_ready** (`tools/pr_ready.py --quick --base upstream/main` on DESKTOP-G0M27UC, against upstream/main at 62bdd29b2, 11 min 52 s) | Check | Result | | --- | --- | | Scope | ✅ 1 files, +6 −0 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 594 passed (3 min 9 s) | | rustfmt | ✅ (16 s) | | clippy | ✅ (2 min 58 s) | | tests: horizon-client | ❌ 559 passed, 1 failed (5 min 19 s) | | doc tests | ✅ 0 passed (5 s) | | content root tests | ➖ content root untouched | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ➖ not run (--quick): CI's parity job picks the affected harnesses | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | The one failing test, `game::native_hooks::tests::native_loot_kinds_stay_hookable`, is unrelated to this change: it reads `horizon-world/src/loot.rs` with `include_str!` and looks for `" } "`, which isn't there on a Windows checkout with `core.autocrlf` (the file is CRLF there), so `find(..).unwrap()` panics. It fails the same way on `main` here; CI (LF) is unaffected. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 06:27:26 +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#6816
No description provided.