[PR #2387] [MERGED] Point the recovery compass at the player's last death #4265

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/2387
Author: @kacpherek
Created: 10/26/2026
Status: ✅ Merged
Merged: 10/27/2026
Merged by: @ludovic111

Base: main ← Head: fix/recovery-compass-death-spot


📝 Commits (3)

  • 4d9ead7 Point the recovery compass at the player's last death
  • c17da16 Merge remote-tracking branch 'origin/main' into HEAD
  • 2d89e9a Merge main into fix/recovery-compass-death-spot

📊 Changes

8 files changed (+53 additions, -16 deletions)

View changed files

📝 crates/horizon-client/src/game.rs (+3 -0)
📝 crates/horizon-client/src/game/item_draw.rs (+5 -0)
📝 crates/horizon-client/src/game/lan_actions.rs (+1 -1)
📝 crates/horizon-client/src/game/remote.rs (+6 -0)
📝 crates/horizon-client/src/lan/guest.rs (+1 -1)
📝 crates/horizon-client/src/lan/hub.rs (+14 -14)
📝 crates/horizon-client/src/lan/playerdata.rs (+2 -0)
📝 crates/horizon-client/src/save.rs (+21 -0)

📄 Description

What and why

A recovery compass never pointed at where you died; it just spun. The compass reads the owner's last death location, but the local player's item owner never had one, because nothing recorded it outside of LAN guests.

Now:

  • The local player's death records the dimension and block (Player.die), and it is saved and loaded as LastDeathLocation in the player NBT, in the same format vanilla uses.
  • On the server thread the server keeps this for each player (also loaded from and saved to their player data), and sends it in the Login, Respawn and level-change packets. The client reads it from there.
  • The item owner built for the local player now carries it, so the existing compass code picks it up (and spins in another dimension, like vanilla).

Vanilla reference

  • CompassAngleState (RECOVERY target uses Player.getLastDeathLocation)
  • Player.die, Player.readAdditionalSaveData / addAdditionalSaveData (LastDeathLocation, GlobalPos.CODEC)
  • ClientPacketListener.handleLogin / handleRespawn, ServerPlayer.createCommonSpawnInfo (getLastDeathLocation)

Self-check

cargo check -p horizon-client passes.


🔄 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/2387 **Author:** [@kacpherek](https://github.com/kacpherek) **Created:** 10/26/2026 **Status:** ✅ Merged **Merged:** 10/27/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/recovery-compass-death-spot` --- ### 📝 Commits (3) - [`4d9ead7`](https://github.com/horizon-rust/horizon/commit/4d9ead721e547a3a4983ebf738c316674be1c55b) Point the recovery compass at the player's last death - [`c17da16`](https://github.com/horizon-rust/horizon/commit/c17da1690725bdf10ce37bc1bc04c25c1be2068a) Merge remote-tracking branch 'origin/main' into HEAD - [`2d89e9a`](https://github.com/horizon-rust/horizon/commit/2d89e9ae5f690b249afeb8b837355132b1d37a54) Merge main into fix/recovery-compass-death-spot ### 📊 Changes **8 files changed** (+53 additions, -16 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game.rs` (+3 -0) 📝 `crates/horizon-client/src/game/item_draw.rs` (+5 -0) 📝 `crates/horizon-client/src/game/lan_actions.rs` (+1 -1) 📝 `crates/horizon-client/src/game/remote.rs` (+6 -0) 📝 `crates/horizon-client/src/lan/guest.rs` (+1 -1) 📝 `crates/horizon-client/src/lan/hub.rs` (+14 -14) 📝 `crates/horizon-client/src/lan/playerdata.rs` (+2 -0) 📝 `crates/horizon-client/src/save.rs` (+21 -0) </details> ### 📄 Description ## What and why A recovery compass never pointed at where you died; it just spun. The compass reads the owner's last death location, but the local player's item owner never had one, because nothing recorded it outside of LAN guests. Now: - The local player's death records the dimension and block (`Player.die`), and it is saved and loaded as `LastDeathLocation` in the player NBT, in the same format vanilla uses. - On the server thread the server keeps this for each player (also loaded from and saved to their player data), and sends it in the Login, Respawn and level-change packets. The client reads it from there. - The item owner built for the local player now carries it, so the existing compass code picks it up (and spins in another dimension, like vanilla). ## Vanilla reference - `CompassAngleState` (RECOVERY target uses `Player.getLastDeathLocation`) - `Player.die`, `Player.readAdditionalSaveData` / `addAdditionalSaveData` (`LastDeathLocation`, `GlobalPos.CODEC`) - `ClientPacketListener.handleLogin` / `handleRespawn`, `ServerPlayer.createCommonSpawnInfo` (`getLastDeathLocation`) ## Self-check `cargo check -p horizon-client` passes. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 04:15:55 +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#4265
No description provided.