[PR #6351] [MERGED] A respawn into another level of the same dimension type makes a new level #6819

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

📋 Pull Request Information

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

Base: main ← Head: fix/6316-level-hooks-same-type


📝 Commits (1)

  • 0ccddf8 A respawn into another level of the same dimension type makes a new level

📊 Changes

1 file changed (+3 additions, -1 deletions)

View changed files

📝 crates/horizon-client/src/game/remote.rs (+3 -1)

📄 Description

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

What and why

Fixes #6316.

enter_remote_dimension decided whether to keep the client level with r.dimension.name == dimension.name && keep_world, the dimension type's name. Vanilla's ClientPacketListener.handleRespawn compares the level key (spawnInfo.dimension() against the current level's dimension(), if_acmpeq at offset 50 in 26.3) and makes a new ClientLevel (Minecraft.setLevel) when they differ.

So a respawn or move between two levels that share a dimension type (a data pack or mod dimension using minecraft:overworld's type) kept the old level's chunks, entities and lighting, and fired neither native_client_level_load nor native_client_level_unload (#6201); heard_level kept the old level and the next unload named the wrong one.

same now compares heard_level, the level key the client last entered, with spawn.dimension. That covers what the issue proposes (the hooks) and also the world reset that goes with a new ClientLevel. Respawning in the same level is unchanged, and the login path (keep_world = false) is unchanged.

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.handleRespawn: the level-key comparison, then new ClientLevel(..) and Minecraft.setLevel.

Not run in game here: it needs a data pack dimension with the Overworld's type (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 55 s)

Check Result
Scope ✅ 1 files, +3 −1
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 594 passed (3 min 32 s)
rustfmt ✅ (18 s)
clippy ✅ (3 min 7 s)
tests: horizon-client ❌ 559 passed, 1 failed (4 min 48 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: it fails on any Windows checkout with core.autocrlf (#6372, fixed in #6375). 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/6351 **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/6316-level-hooks-same-type` --- ### 📝 Commits (1) - [`0ccddf8`](https://github.com/horizon-rust/horizon/commit/0ccddf82b8376869f7e953ea635abb199de33adf) A respawn into another level of the same dimension type makes a new level ### 📊 Changes **1 file changed** (+3 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/remote.rs` (+3 -1) </details> ### 📄 Description > 🤖 Opened by breachato's AI agent (Claude Code, Claude Opus 5.5), not by breachato personally. ## What and why Fixes #6316. `enter_remote_dimension` decided whether to keep the client level with `r.dimension.name == dimension.name && keep_world`, the dimension **type**'s name. Vanilla's `ClientPacketListener.handleRespawn` compares the **level key** (`spawnInfo.dimension()` against the current level's `dimension()`, `if_acmpeq` at offset 50 in 26.3) and makes a new `ClientLevel` (`Minecraft.setLevel`) when they differ. So a respawn or move between two levels that share a dimension type (a data pack or mod dimension using `minecraft:overworld`'s type) kept the old level's chunks, entities and lighting, and fired neither `native_client_level_load` nor `native_client_level_unload` (#6201); `heard_level` kept the old level and the next unload named the wrong one. `same` now compares `heard_level`, the level key the client last entered, with `spawn.dimension`. That covers what the issue proposes (the hooks) and also the world reset that goes with a new `ClientLevel`. Respawning in the same level is unchanged, and the login path (`keep_world = false`) is unchanged. ## Kind - [x] 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.handleRespawn`: the level-key comparison, then `new ClientLevel(..)` and `Minecraft.setLevel`. Not run in game here: it needs a data pack dimension with the Overworld's type (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 55 s) | Check | Result | | --- | --- | | Scope | ✅ 1 files, +3 −1 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 594 passed (3 min 32 s) | | rustfmt | ✅ (18 s) | | clippy | ✅ (3 min 7 s) | | tests: horizon-client | ❌ 559 passed, 1 failed (4 min 48 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: it fails on any Windows checkout with `core.autocrlf` (#6372, fixed in #6375). 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:30 +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#6819
No description provided.