[PR #2407] [MERGED] Honour spawn-protection on a dedicated server #4287

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

📋 Pull Request Information

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

Base: main ← Head: fix/spawn-protection


📝 Commits (2)

  • 4575f4f Honour spawn-protection on a dedicated server
  • c33a2a5 Merge remote-tracking branch 'origin/main' into HEAD

📊 Changes

3 files changed (+71 additions, -13 deletions)

View changed files

📝 crates/horizon-client/src/game/dedicated.rs (+3 -0)
📝 crates/horizon-client/src/game/lan_actions.rs (+64 -13)
📝 crates/horizon-client/src/lan/hub.rs (+4 -0)

📄 Description

What and why

On a dedicated server, spawn-protection was read from server.properties but never used, so anyone could break and build at the world spawn. Now, when the ops list is not empty and the radius is above 0, players who are not operators cannot start digging or use an item on a block within the radius of the world spawn (square, Overworld). They see the red "is under spawn protection" message above the hotbar and the client gets the blocks put back. Operators, an empty ops list and a radius of 0 are not affected.

Not covered here: other vanilla mayInteract uses (buckets, spawn eggs, armor stands and similar), which go through item-use paths rather than the two packets above.

Vanilla reference

  • DedicatedServer.isUnderSpawnProtection
  • ServerPlayerGameMode.handleBlockBreakAction (START_DESTROY_BLOCK)
  • ServerGamePacketListenerImpl.handleUseItemOn
  • ServerPlayer.sendSpawnProtectionMessage

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/2407 **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/spawn-protection` --- ### 📝 Commits (2) - [`4575f4f`](https://github.com/horizon-rust/horizon/commit/4575f4f1dffa435d615f02b1da7d33b725f7f552) Honour spawn-protection on a dedicated server - [`c33a2a5`](https://github.com/horizon-rust/horizon/commit/c33a2a5d1985cba04458bcd25a38b2d034889008) Merge remote-tracking branch 'origin/main' into HEAD ### 📊 Changes **3 files changed** (+71 additions, -13 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/dedicated.rs` (+3 -0) 📝 `crates/horizon-client/src/game/lan_actions.rs` (+64 -13) 📝 `crates/horizon-client/src/lan/hub.rs` (+4 -0) </details> ### 📄 Description ## What and why On a dedicated server, `spawn-protection` was read from `server.properties` but never used, so anyone could break and build at the world spawn. Now, when the ops list is not empty and the radius is above 0, players who are not operators cannot start digging or use an item on a block within the radius of the world spawn (square, Overworld). They see the red "is under spawn protection" message above the hotbar and the client gets the blocks put back. Operators, an empty ops list and a radius of 0 are not affected. Not covered here: other vanilla `mayInteract` uses (buckets, spawn eggs, armor stands and similar), which go through item-use paths rather than the two packets above. ## Vanilla reference - `DedicatedServer.isUnderSpawnProtection` - `ServerPlayerGameMode.handleBlockBreakAction` (START_DESTROY_BLOCK) - `ServerGamePacketListenerImpl.handleUseItemOn` - `ServerPlayer.sendSpawnProtectionMessage` ## 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:04 +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#4287
No description provided.