[PR #72] [MERGED] SMP: keep water, fire, pistons, explosions, buckets and blows out of claims #79

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/72
Author: @ludovic111
Created: 10/30/2026
Status: ✅ Merged
Merged: 10/31/2026
Merged by: @ludovic111

Base: main ← Head: feat/smp-grief


📝 Commits (10+)

  • 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
  • 803907a SMP: keep water, fire, pistons, explosions, buckets and blows out of claims (hooks 22)
  • b0e3d98 SMP claims: pinned to horizon#4739's head (API 22)
  • aaf6cce SMP claims: pinned to horizon main with #4739 (API 22)
  • 4364dbf Merge remote-tracking branch 'origin/main' into feat/smp-places

📊 Changes

18 files changed (+1970 additions, -26 deletions)

View changed files

📝 native/smp/Cargo.lock (+1 -1)
📝 native/smp/Cargo.toml (+1 -1)
📝 native/smp/README.md (+38 -6)
📝 native/smp/compatibility.json (+2 -2)
➕ native/smp/mixins/smp/attack_entity.rs (+10 -0)
➕ native/smp/mixins/smp/block_spread.rs (+14 -0)
➕ native/smp/mixins/smp/destroy_block.rs (+4 -0)
➕ native/smp/mixins/smp/explosion_detonate.rs (+8 -0)
➕ native/smp/mixins/smp/fill_bucket.rs (+4 -0)
📝 native/smp/mixins/smp/glue.rs (+224 -9)
📝 native/smp/mixins/smp/horizon-mixin.toml (+97 -3)
➕ native/smp/mixins/smp/piston_move.rs (+24 -0)
➕ native/smp/mixins/smp/right_click_block.rs (+4 -0)
➕ native/smp/mixins/smp/smp_claims.rs (+642 -0)
📝 native/smp/mixins/smp/smp_economy.rs (+9 -0)
➕ native/smp/mixins/smp/smp_places.rs (+694 -0)
📝 native/smp/proof.py (+190 -4)
📝 native/smp/src/lib.rs (+4 -0)

📄 Description

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

Stacked on #69 (claims). Uses horizon-rust/horizon#4739 (hook points API 22), merged: pinned to its merge commit
84ebab8 on main. horizon-rust/horizon#4766 (open) keeps clients from showing a refused sticky pull.

What

Closes the claims' gaps the README listed: the world itself stays out of a claim.

  • Fluids and fire (native_block_spread): no water or lava flows, no fire spreads or burns into a claim from
    land that isn't its owner's (or a player's they trust). Inside a claim, and between unclaimed blocks, as vanilla.
  • Pistons (native_piston_move): a piston outside a claim pushes, pulls or destroys nothing in it.
  • Explosions (native_explosion_detonate): claimed blocks are taken out of every explosion's blocks, whoever lit
    it (TNT, creepers, beds). Entities are hurt as before.
  • Buckets (native_fill_bucket): guarded where they fill or empty, also when aimed at a fluid with no block behind.
  • Blows (native_attack_entity): a claim's item frames, armor stands, paintings, boats, minecarts and animals
    take no hits from untrusted players. The list is claims.protected_entities; monsters and players aren't in it.
  • Right clicking an entity (a frame's item, an armor stand's items, shearing, leads) waits for horizon#4648's
    native_interact_entity.

The spread and piston hooks are asked on every flow. They read the open claims with try_lock, so they never wait,
and look a chunk up without allocating. The claims index is now dimension → (chunk x, z).

0.8.0, compatibility.json hooks 22.

Proof

native.py proof smp on a dedicated server with Alex and Steve (console: peaceful, no monsters). The new
world_guard step runs after /untrust Steve, with a control outside the claim for each check:

Check In the claim Outside (control)
water two blocks east air water[level=1]
fire on netherrack between planks planks intact planks burned, fire
piston pushing dirt in / away extended=false, dirt stays extended=true
Steve's water bucket on the claim's ground air, action bar "This land is claimed by Alex."
Steve's fist on Alex's cow health 10.0 9.0 once trusted
TNT two blocks south 144 blocks unchanged crater (air)

The claims step no longer fails when grass spreads onto its test dirt (it checks the block isn't broken). The whole
proof passes: "ok": true.

Cost: +0.03 ms MSPT for the whole SMP with 58 bots, once #63 is in (see the comment on #69). cargo test passes (35 tests, one new: the_world_stays_out_of_a_claim).

🤖 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/72 **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-grief` --- ### 📝 Commits (10+) - [`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 - [`803907a`](https://github.com/horizon-rust/horizon-mods/commit/803907aaa5225d3cbe8d990e0b9eb804a8e7dda5) SMP: keep water, fire, pistons, explosions, buckets and blows out of claims (hooks 22) - [`b0e3d98`](https://github.com/horizon-rust/horizon-mods/commit/b0e3d98b52194545ebafbcedc0d8d9ecd3c1002b) SMP claims: pinned to horizon#4739's head (API 22) - [`aaf6cce`](https://github.com/horizon-rust/horizon-mods/commit/aaf6ccefcc8f2983c47a8433b03e9c42b13f5a52) SMP claims: pinned to horizon main with #4739 (API 22) - [`4364dbf`](https://github.com/horizon-rust/horizon-mods/commit/4364dbfba3036c7a6d4327b8010b56f68c9fe9aa) Merge remote-tracking branch 'origin/main' into feat/smp-places ### 📊 Changes **18 files changed** (+1970 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` (+38 -6) 📝 `native/smp/compatibility.json` (+2 -2) ➕ `native/smp/mixins/smp/attack_entity.rs` (+10 -0) ➕ `native/smp/mixins/smp/block_spread.rs` (+14 -0) ➕ `native/smp/mixins/smp/destroy_block.rs` (+4 -0) ➕ `native/smp/mixins/smp/explosion_detonate.rs` (+8 -0) ➕ `native/smp/mixins/smp/fill_bucket.rs` (+4 -0) 📝 `native/smp/mixins/smp/glue.rs` (+224 -9) 📝 `native/smp/mixins/smp/horizon-mixin.toml` (+97 -3) ➕ `native/smp/mixins/smp/piston_move.rs` (+24 -0) ➕ `native/smp/mixins/smp/right_click_block.rs` (+4 -0) ➕ `native/smp/mixins/smp/smp_claims.rs` (+642 -0) 📝 `native/smp/mixins/smp/smp_economy.rs` (+9 -0) ➕ `native/smp/mixins/smp/smp_places.rs` (+694 -0) 📝 `native/smp/proof.py` (+190 -4) 📝 `native/smp/src/lib.rs` (+4 -0) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. Stacked on #69 (claims). Uses horizon-rust/horizon#4739 (hook points API 22), merged: pinned to its merge commit 84ebab8 on main. horizon-rust/horizon#4766 (open) keeps clients from showing a refused sticky pull. ## What Closes the claims' gaps the README listed: the world itself stays out of a claim. - **Fluids and fire** (`native_block_spread`): no water or lava flows, no fire spreads or burns into a claim from land that isn't its owner's (or a player's they trust). Inside a claim, and between unclaimed blocks, as vanilla. - **Pistons** (`native_piston_move`): a piston outside a claim pushes, pulls or destroys nothing in it. - **Explosions** (`native_explosion_detonate`): claimed blocks are taken out of every explosion's blocks, whoever lit it (TNT, creepers, beds). Entities are hurt as before. - **Buckets** (`native_fill_bucket`): guarded where they fill or empty, also when aimed at a fluid with no block behind. - **Blows** (`native_attack_entity`): a claim's item frames, armor stands, paintings, boats, minecarts and animals take no hits from untrusted players. The list is `claims.protected_entities`; monsters and players aren't in it. - Right clicking an entity (a frame's item, an armor stand's items, shearing, leads) waits for horizon#4648's `native_interact_entity`. The spread and piston hooks are asked on every flow. They read the open claims with `try_lock`, so they never wait, and look a chunk up without allocating. The claims index is now dimension → (chunk x, z). 0.8.0, `compatibility.json` hooks 22. ## Proof `native.py proof smp` on a dedicated server with Alex and Steve (console: peaceful, no monsters). The new `world_guard` step runs after `/untrust Steve`, with a control outside the claim for each check: | Check | In the claim | Outside (control) | |---|---|---| | water two blocks east | `air` | `water[level=1]` | | fire on netherrack between planks | planks intact | planks burned, fire | | piston pushing dirt in / away | `extended=false`, dirt stays | `extended=true` | | Steve's water bucket on the claim's ground | `air`, action bar "This land is claimed by Alex." | | | Steve's fist on Alex's cow | health 10.0 | 9.0 once trusted | | TNT two blocks south | 144 blocks unchanged | crater (`air`) | The claims step no longer fails when grass spreads onto its test dirt (it checks the block isn't broken). The whole proof passes: `"ok": true`. Cost: +0.03 ms MSPT for the whole SMP with 58 bots, once #63 is in (see the comment on #69). `cargo test` passes (35 tests, one new: `the_world_stays_out_of_a_claim`). 🤖 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#79
No description provided.