[PR #69] [MERGED] SMP: land claims (/claim, /trust) #76

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon-mods/pull/69
Author: @ludovic111
Created: 10/30/2026
Status: ✅ Merged
Merged: 10/31/2026
Merged by: @ludovic111

Base: main ← Head: feat/smp-claims


📝 Commits (8)

  • b9bd159 SMP: places (spawn, homes, warps, /tpa) and /rules
  • 26079e7 SMP places: hook points API 16, and the proof waits for each answer
  • 0eb6ca7 SMP places: hook points API 18 (main took 16 and 17)
  • 1ec378a SMP places: hook points API 21 (main's mod screens took 18 to 20)
  • 63f2fa9 SMP places: pinned to horizon main with #4610 (API 21)
  • ec056f9 SMP: land claims (/claim, /trust) on the block hooks
  • 4364dbf Merge remote-tracking branch 'origin/main' into feat/smp-places
  • fefd3e8 Merge branch 'feat/smp-places' into feat/smp-claims

📊 Changes

13 files changed (+1563 additions, -26 deletions)

View changed files

📝 native/smp/Cargo.lock (+1 -1)
📝 native/smp/Cargo.toml (+1 -1)
📝 native/smp/README.md (+32 -6)
📝 native/smp/compatibility.json (+2 -2)
➕ native/smp/mixins/smp/destroy_block.rs (+4 -0)
📝 native/smp/mixins/smp/glue.rs (+169 -9)
📝 native/smp/mixins/smp/horizon-mixin.toml (+37 -3)
➕ native/smp/mixins/smp/right_click_block.rs (+4 -0)
➕ native/smp/mixins/smp/smp_claims.rs (+491 -0)
📝 native/smp/mixins/smp/smp_economy.rs (+9 -0)
➕ native/smp/mixins/smp/smp_places.rs (+694 -0)
📝 native/smp/proof.py (+115 -4)
📝 native/smp/src/lib.rs (+4 -0)

📄 Description

🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself.

Stacked on #66 (places) and #62 (the lottery): review only the last commit, ec056f9. It uses horizon-rust/horizon#4610's hook points (API 21), merged: compatibility.json pins main's b5b451d.

What

Phase 4 of the SMP, part 2: land claims, for stock clients.

Command Does
/claim, /claim info, /unclaim claims the chunk you stand in (all its height), says whose it is, frees it (operators of level 3: anyone's)
/claims your chunks, your limit, whom you trust
/trust <player>, /untrust <player> lets a player build and use things on all your land, or stops it
  • What is guarded. In a claimed chunk only the owner, the players they trust and operators of level 3 may act. Two hooks cover it:
    • breaking a block: native_destroy_block, from #4483;
    • right clicking a block: native_right_click_block, from horizon#4610. That covers doors, chests, levers, buttons, placing a block, and a bucket or flint on a block.
  • What a refused player sees. Nothing happens, their client gets the block back, and the action bar says "This land is claimed by Alex." (native_action_bar, at most every 2 s).
  • Limit. The chunks a player may hold grow with the time played here, counted by places (#66): 4, 16 from 5 h, 36 from 20 h, 64 from 100 h, in config.json's claims.
  • Cost. A hash lookup per break and per right click. Nothing per tick.
  • Not guarded yet: explosions, fire, pistons, liquids flowing in, entities (item frames, armour stands, animals) and buckets used in the air. The README says so. The spawn is guarded by vanilla's spawn-protection.

Proof

native.py proof smp on a real dedicated server with two horizon-ctl clients, on fresh temporary data: "ok": true.

  1. Alex claimed his chunk: "Claimed this chunk (x -16 to -1, z 0 to 15), 1 of 4."
  2. In it, Steve's interact on a lever left it powered=false, his break left the dirt, and his place of oak planks left air. His action bar read "This land is claimed by Alex.".
  3. After /trust Steve, the lever went powered=true and the dirt broke.
  4. /claims listed the chunk and "Trusted: Steve", and claims.json was checked after the server stopped.

The rest of the SMP proof passed in the same run.

cargo test: 34 passed (2 new). cargo clippy --all-targets: clean. native.py check smp: ok on main b5b451d.

🤖 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-mods/pull/69 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/30/2026 **Status:** ✅ Merged **Merged:** 10/31/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `feat/smp-claims` --- ### 📝 Commits (8) - [`b9bd159`](https://github.com/horizon-rust/horizon-mods/commit/b9bd159dcf76e7e61daac2d4891c20f3612101d1) SMP: places (spawn, homes, warps, /tpa) and /rules - [`26079e7`](https://github.com/horizon-rust/horizon-mods/commit/26079e71ed96ba45f596491777182be1168c5abf) SMP places: hook points API 16, and the proof waits for each answer - [`0eb6ca7`](https://github.com/horizon-rust/horizon-mods/commit/0eb6ca75c36e4fd8a2019844ac151f5bbea7a52b) SMP places: hook points API 18 (main took 16 and 17) - [`1ec378a`](https://github.com/horizon-rust/horizon-mods/commit/1ec378ac96d3f03dd1950d06c447f37b191c2927) SMP places: hook points API 21 (main's mod screens took 18 to 20) - [`63f2fa9`](https://github.com/horizon-rust/horizon-mods/commit/63f2fa9f0169d3470c9cf4bc66043d3b54042b37) SMP places: pinned to horizon main with #4610 (API 21) - [`ec056f9`](https://github.com/horizon-rust/horizon-mods/commit/ec056f9f0291c847b5e76e1bf849c21934fabb31) SMP: land claims (/claim, /trust) on the block hooks - [`4364dbf`](https://github.com/horizon-rust/horizon-mods/commit/4364dbfba3036c7a6d4327b8010b56f68c9fe9aa) Merge remote-tracking branch 'origin/main' into feat/smp-places - [`fefd3e8`](https://github.com/horizon-rust/horizon-mods/commit/fefd3e8c6bc4c90f1fc1ae57540e131c99794870) Merge branch 'feat/smp-places' into feat/smp-claims ### 📊 Changes **13 files changed** (+1563 additions, -26 deletions) <details> <summary>View changed files</summary> 📝 `native/smp/Cargo.lock` (+1 -1) 📝 `native/smp/Cargo.toml` (+1 -1) 📝 `native/smp/README.md` (+32 -6) 📝 `native/smp/compatibility.json` (+2 -2) ➕ `native/smp/mixins/smp/destroy_block.rs` (+4 -0) 📝 `native/smp/mixins/smp/glue.rs` (+169 -9) 📝 `native/smp/mixins/smp/horizon-mixin.toml` (+37 -3) ➕ `native/smp/mixins/smp/right_click_block.rs` (+4 -0) ➕ `native/smp/mixins/smp/smp_claims.rs` (+491 -0) 📝 `native/smp/mixins/smp/smp_economy.rs` (+9 -0) ➕ `native/smp/mixins/smp/smp_places.rs` (+694 -0) 📝 `native/smp/proof.py` (+115 -4) 📝 `native/smp/src/lib.rs` (+4 -0) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. **Stacked on #66 (places) and #62 (the lottery): review only the last commit, `ec056f9`.** It uses horizon-rust/horizon#4610's hook points (API 21), merged: `compatibility.json` pins main's `b5b451d`. ## What Phase 4 of the SMP, part 2: land claims, for stock clients. | Command | Does | |---|---| | `/claim`, `/claim info`, `/unclaim` | claims the chunk you stand in (all its height), says whose it is, frees it (operators of level 3: anyone's) | | `/claims` | your chunks, your limit, whom you trust | | `/trust <player>`, `/untrust <player>` | lets a player build and use things on all your land, or stops it | - **What is guarded.** In a claimed chunk only the owner, the players they trust and operators of level 3 may act. Two hooks cover it: - breaking a block: `native_destroy_block`, from #4483; - right clicking a block: `native_right_click_block`, from horizon#4610. That covers doors, chests, levers, buttons, placing a block, and a bucket or flint on a block. - **What a refused player sees.** Nothing happens, their client gets the block back, and the action bar says "This land is claimed by Alex." (`native_action_bar`, at most every 2 s). - **Limit.** The chunks a player may hold grow with the time played here, counted by places (#66): 4, 16 from 5 h, 36 from 20 h, 64 from 100 h, in `config.json`'s `claims`. - **Cost.** A hash lookup per break and per right click. Nothing per tick. - **Not guarded yet:** explosions, fire, pistons, liquids flowing in, entities (item frames, armour stands, animals) and buckets used in the air. The README says so. The spawn is guarded by vanilla's `spawn-protection`. ## Proof `native.py proof smp` on a real dedicated server with two `horizon-ctl` clients, on fresh temporary data: `"ok": true`. 1. Alex claimed his chunk: "Claimed this chunk (x -16 to -1, z 0 to 15), 1 of 4." 2. In it, Steve's `interact` on a lever left it `powered=false`, his `break` left the dirt, and his `place` of oak planks left air. His action bar read "This land is claimed by Alex.". 3. After `/trust Steve`, the lever went `powered=true` and the dirt broke. 4. `/claims` listed the chunk and "Trusted: Steve", and `claims.json` was checked after the server stopped. The rest of the SMP proof passed in the same run. `cargo test`: 34 passed (2 new). `cargo clippy --all-targets`: clean. `native.py check smp`: ok on main `b5b451d`. 🤖 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 04:03:03 +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-mods#76
No description provided.