[PR #66] [MERGED] SMP: places (spawn, homes, warps, /tpa) and /rules #74

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

📋 Pull Request Information

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

Base: main ← Head: feat/smp-places


📝 Commits (6)

  • 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)
  • 4364dbf Merge remote-tracking branch 'origin/main' into feat/smp-places

📊 Changes

9 files changed (+885 additions, -24 deletions)

View changed files

📝 native/smp/Cargo.lock (+1 -1)
📝 native/smp/Cargo.toml (+1 -1)
📝 native/smp/README.md (+19 -5)
📝 native/smp/compatibility.json (+2 -2)
📝 native/smp/mixins/smp/glue.rs (+89 -8)
📝 native/smp/mixins/smp/horizon-mixin.toml (+9 -3)
➕ native/smp/mixins/smp/smp_places.rs (+685 -0)
📝 native/smp/proof.py (+77 -4)
📝 native/smp/src/lib.rs (+2 -0)

📄 Description

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

Stacked on #62 (the lottery): review only the last commit, b9bd159 the pin commits after it, and a sturdier say in the proof. 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 1: places. Players use stock clients and chat commands only.

Command Does
/spawn, /setspawn (level 3) to the server's spawn; sets it
/home [name], /sethome [name], /delhome [name], /homes homes; how many a player may have grows with the time played here (1, 2 from 5 h, 3 from 20 h, 5 from 100 h)
/warp <name>, /warps, /setwarp//delwarp (level 3) warps
/tpa <player>, /tpaccept [player], /tpdeny [player] teleport requests; the asker goes to where the other player is when the warmup ends
/rules the server's rules (config.json)
  • A teleport waits warmup_seconds (3). A move of more than half a block, a change of level or a health drop calls it off. cooldown_seconds (10) must pass between two teleports.
  • The move is vanilla's tp, run as the server: execute in <level> run tp <name> x y z through native_run_command. It crosses levels and lands like any other teleport.
  • places.json holds the spawn, the warps, the homes and the time played. It is written atomically: at once when places change, once a minute when only the time played does. A damaged file turns places off and is never replaced.
  • Cost: nothing per tick while no teleport is warming up. Once a second, the time played and request expiry.

Proof

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

  • Steve was teleported to the Nether's roof, then /home base brought him back to the overworld at his home: (-9.5, -60, 1.5).
  • Walking during the warmup gave "Teleport called off: you moved."; damage Steve 2 gave "you were hurt".
  • After /tpa + /tpaccept, Alex stood at Steve's position.
  • A second home at 0 h played was refused ("1 of 1"). /setwarp was refused to a level 0 player, and /warps listed shop.
  • places.json was checked after the server stopped.
  • The economy, trade, coinflip and lottery steps passed in the same run.

The proof now also sets difficulty peaceful and spawn_monsters false from the console: a slime killed Steve on the flat world in one run, with difficulty=peaceful in server.properties.

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

Next: claims (/claim, /trust), on native_destroy_block and native_right_click_block.

🤖 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/66 **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-places` --- ### 📝 Commits (6) - [`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) - [`4364dbf`](https://github.com/horizon-rust/horizon-mods/commit/4364dbfba3036c7a6d4327b8010b56f68c9fe9aa) Merge remote-tracking branch 'origin/main' into feat/smp-places ### 📊 Changes **9 files changed** (+885 additions, -24 deletions) <details> <summary>View changed files</summary> 📝 `native/smp/Cargo.lock` (+1 -1) 📝 `native/smp/Cargo.toml` (+1 -1) 📝 `native/smp/README.md` (+19 -5) 📝 `native/smp/compatibility.json` (+2 -2) 📝 `native/smp/mixins/smp/glue.rs` (+89 -8) 📝 `native/smp/mixins/smp/horizon-mixin.toml` (+9 -3) ➕ `native/smp/mixins/smp/smp_places.rs` (+685 -0) 📝 `native/smp/proof.py` (+77 -4) 📝 `native/smp/src/lib.rs` (+2 -0) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. **Stacked on #62 (the lottery): review only the last commit, `b9bd159` the pin commits after it, and a sturdier `say` in the proof.** 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 1: places. Players use stock clients and chat commands only. | Command | Does | |---|---| | `/spawn`, `/setspawn` (level 3) | to the server's spawn; sets it | | `/home [name]`, `/sethome [name]`, `/delhome [name]`, `/homes` | homes; how many a player may have grows with the time played here (1, 2 from 5 h, 3 from 20 h, 5 from 100 h) | | `/warp <name>`, `/warps`, `/setwarp`/`/delwarp` (level 3) | warps | | `/tpa <player>`, `/tpaccept [player]`, `/tpdeny [player]` | teleport requests; the asker goes to where the other player is when the warmup ends | | `/rules` | the server's rules (`config.json`) | - A teleport waits `warmup_seconds` (3). A move of more than half a block, a change of level or a health drop calls it off. `cooldown_seconds` (10) must pass between two teleports. - The move is vanilla's `tp`, run as the server: `execute in <level> run tp <name> x y z` through `native_run_command`. It crosses levels and lands like any other teleport. - `places.json` holds the spawn, the warps, the homes and the time played. It is written atomically: at once when places change, once a minute when only the time played does. A damaged file turns places off and is never replaced. - Cost: nothing per tick while no teleport is warming up. Once a second, the time played and request expiry. ## Proof `native.py proof smp` on a real dedicated server with two `horizon-ctl` clients, on fresh temporary data: `"ok": true`. - Steve was teleported to the Nether's roof, then `/home base` brought him back to the overworld at his home: (-9.5, -60, 1.5). - Walking during the warmup gave "Teleport called off: you moved."; `damage Steve 2` gave "you were hurt". - After `/tpa` + `/tpaccept`, Alex stood at Steve's position. - A second home at 0 h played was refused ("1 of 1"). `/setwarp` was refused to a level 0 player, and `/warps` listed `shop`. - `places.json` was checked after the server stopped. - The economy, trade, coinflip and lottery steps passed in the same run. The proof now also sets `difficulty peaceful` and `spawn_monsters false` from the console: a slime killed Steve on the flat world in one run, with `difficulty=peaceful` in `server.properties`. `cargo test`: 32 passed (4 new). `cargo clippy --all-targets`: clean. `native.py check smp`: ok on main `b5b451d`. Next: claims (`/claim`, `/trust`), on `native_destroy_block` and `native_right_click_block`. 🤖 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:01 +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#74
No description provided.