[PR #2398] [MERGED] Let a compass lock onto a lodestone #4277

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

📋 Pull Request Information

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

Base: main ← Head: fix/lodestone-compass-use


📝 Commits (1)

  • c439b80 Let a compass lock onto a lodestone

📊 Changes

6 files changed (+148 additions, -1 deletions)

View changed files

📝 crates/horizon-client/src/game.rs (+2 -0)
📝 crates/horizon-client/src/game/lan_actions.rs (+1 -0)
📝 crates/horizon-client/src/game/maps.rs (+87 -0)
📝 crates/horizon-client/src/item_sync.rs (+16 -0)
📝 crates/horizon-client/src/lan/guest.rs (+15 -0)
📝 crates/horizon-protocol/src/item.rs (+27 -1)

📄 Description

What and why

A lodestone compass could not be made: using a compass on a lodestone did nothing. The needle already renders from the lodestone_tracker component, but nothing ever set it.

Now:

  • Using a compass on a lodestone plays the lock sound and sets the target (dimension and block). A single compass in survival changes in place; with a stack, or in creative, one locked compass is split off and given to the player (dropped if the inventory is full).
  • Every tick a carried compass whose lodestone block is gone loses its target, like LodestoneTracker.tick. A target in an unloaded chunk is left alone, since Horizon has no point-of-interest manager to ask.
  • The component travels in item packets (LodestoneTracker added to the protocol's component list), so the window on the server thread sees the locked compass, and guests do too. The guest path runs the same use and tick code.

The component is kept in the stack's existing "other components" storage, so it saves and loads with the item.

Vanilla reference

  • CompassItem.useOn
  • CompassItem.inventoryTick, LodestoneTracker.tick
  • LodestoneTracker.STREAM_CODEC

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/2398 **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/lodestone-compass-use` --- ### 📝 Commits (1) - [`c439b80`](https://github.com/horizon-rust/horizon/commit/c439b806b8b4922a8403cba5c2f5e24c82668a2d) Let a compass lock onto a lodestone ### 📊 Changes **6 files changed** (+148 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game.rs` (+2 -0) 📝 `crates/horizon-client/src/game/lan_actions.rs` (+1 -0) 📝 `crates/horizon-client/src/game/maps.rs` (+87 -0) 📝 `crates/horizon-client/src/item_sync.rs` (+16 -0) 📝 `crates/horizon-client/src/lan/guest.rs` (+15 -0) 📝 `crates/horizon-protocol/src/item.rs` (+27 -1) </details> ### 📄 Description ## What and why A lodestone compass could not be made: using a compass on a lodestone did nothing. The needle already renders from the `lodestone_tracker` component, but nothing ever set it. Now: - Using a compass on a lodestone plays the lock sound and sets the target (dimension and block). A single compass in survival changes in place; with a stack, or in creative, one locked compass is split off and given to the player (dropped if the inventory is full). - Every tick a carried compass whose lodestone block is gone loses its target, like `LodestoneTracker.tick`. A target in an unloaded chunk is left alone, since Horizon has no point-of-interest manager to ask. - The component travels in item packets (`LodestoneTracker` added to the protocol's component list), so the window on the server thread sees the locked compass, and guests do too. The guest path runs the same use and tick code. The component is kept in the stack's existing "other components" storage, so it saves and loads with the item. ## Vanilla reference - `CompassItem.useOn` - `CompassItem.inventoryTick`, `LodestoneTracker.tick` - `LodestoneTracker.STREAM_CODEC` ## 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:16:00 +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#4277
No description provided.