[PR #5739] [MERGED] feat(mods): native mods can push the player and set their flying speed #6469

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/5739
Author: @Stink-O
Created: 11/1/2026
Status: ✅ Merged
Merged: 11/1/2026
Merged by: @levzzz5154

Base: main ← Head: native/push-and-flying-speed


📝 Commits (6)

  • 8f257f4 feat(mods): native mods can push the player and set their flying speed
  • 8b9556c Merge main into #5739
  • 7096f3f fix(mods): save a player's flying speed and document the motion helpers
  • 648a652 Merge remote-tracking branch 'hr/main' into pr-5739
  • d3fb451 Flying speed: the server's movement replay uses it; docs: client pushes and the anticheat, false inside a player's hook
  • 9203ebc Merge remote-tracking branch 'hr/main' into pr-5739

📊 Changes

9 files changed (+198 additions, -20 deletions)

View changed files

📝 crates/horizon-client/src/game.rs (+1 -0)
📝 crates/horizon-client/src/game/lan_actions.rs (+1 -0)
➕ crates/horizon-client/src/game/native_motion.rs (+82 -0)
📝 crates/horizon-client/src/lan/guest.rs (+12 -0)
📝 crates/horizon-client/src/lan/hub.rs (+19 -20)
📝 crates/horizon-client/src/lan/playerdata.rs (+49 -0)
📝 crates/horizon-client/src/save.rs (+9 -0)
📝 docs/native-mods.md (+17 -0)
➕ tools/native-hook-fragments/native_motion.json (+8 -0)

📄 Description

Fixes #5738

🤖 Opened by Stink-O's AI agent (Claude Code, Claude Opus 5.5), not by Stink-O personally.

Part of making Orbital Laser native on Horizon (tracking: #5727); useful beyond it because neither exists for mods today.

What and why

native_push_player([x, y, z]) on a client, added to the local player's velocity as an explosion's knockback is (the window's player moves itself, as vanilla's client does), and native_set_flying_speed(player, speed) for server mods, a player's creative flying speed kept as vanilla keeps its abilities (a respawn or a game mode change keeps it). A test for the push.

The API number comes from its fragment (tools/native-hook-fragments/).

Kind

  • feature

Vanilla reference

The push is added to the motion as an explosion's knockback is; the flying speed is Abilities.flyingSpeed (ClientboundPlayerAbilitiesPacket).

Other projects' code

Stink-O/horizon, a fork of this repository by the same author, MIT (as Horizon): 63ea5c582, 848a0686c. Ported from those commits, reshaped to Horizon's native hooks.

Self-check

pr_ready (tools/pr_ready.py --quick on DESKTOP-SNGRNA4-LINUX, against origin/main at b6ac0602d, 1 min 54 s)

Check Result
Scope ✅ 5 files, +108 −4
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 511 passed (29 s)
rustfmt ✅ (7 s)
Rust ⚠️ 1.97.0 is older than CI's stable (1.99): clippy may flag lints CI doesn't, update with rustup update
clippy ❌ failed; likely the old Rust above (12 s)
tests: horizon-client ✅ 1636 passed (1 min 5 s)
doc tests ✅ 0 passed (1 s)
content root tests ➖ content root untouched
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ➖ not run (--quick): CI's parity job picks the affected harnesses
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

Clippy fails here only on horizon-world/src/worldgen/aquifer/noise_based.rs (manual_range_contains), a lint new in
Rust 1.97 that fails on main too; with that one lint allowed it passes. Tests ran one at a time (RUST_TEST_THREADS=1):
in parallel a GPU test in horizon-client-render segfaults on this machine, on main too.

🤖 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/pull/5739 **Author:** [@Stink-O](https://github.com/Stink-O) **Created:** 11/1/2026 **Status:** ✅ Merged **Merged:** 11/1/2026 **Merged by:** [@levzzz5154](https://github.com/levzzz5154) **Base:** `main` ← **Head:** `native/push-and-flying-speed` --- ### 📝 Commits (6) - [`8f257f4`](https://github.com/horizon-rust/horizon/commit/8f257f4672fe6785e5db685cf6364be6b7e90ec2) feat(mods): native mods can push the player and set their flying speed - [`8b9556c`](https://github.com/horizon-rust/horizon/commit/8b9556cc9d163d0c4ec53fd9a60a53cc2477ffc0) Merge main into #5739 - [`7096f3f`](https://github.com/horizon-rust/horizon/commit/7096f3fe39d524d8ba6de81cbc2c89dabfdd2058) fix(mods): save a player's flying speed and document the motion helpers - [`648a652`](https://github.com/horizon-rust/horizon/commit/648a65259d60e6a06c457dcd20e2050c67d8a613) Merge remote-tracking branch 'hr/main' into pr-5739 - [`d3fb451`](https://github.com/horizon-rust/horizon/commit/d3fb451a44ff7972312d36c91e1dc59a80c30d61) Flying speed: the server's movement replay uses it; docs: client pushes and the anticheat, false inside a player's hook - [`9203ebc`](https://github.com/horizon-rust/horizon/commit/9203ebc1b89c790165e91914defd07b91e5df4a0) Merge remote-tracking branch 'hr/main' into pr-5739 ### 📊 Changes **9 files changed** (+198 additions, -20 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game.rs` (+1 -0) 📝 `crates/horizon-client/src/game/lan_actions.rs` (+1 -0) ➕ `crates/horizon-client/src/game/native_motion.rs` (+82 -0) 📝 `crates/horizon-client/src/lan/guest.rs` (+12 -0) 📝 `crates/horizon-client/src/lan/hub.rs` (+19 -20) 📝 `crates/horizon-client/src/lan/playerdata.rs` (+49 -0) 📝 `crates/horizon-client/src/save.rs` (+9 -0) 📝 `docs/native-mods.md` (+17 -0) ➕ `tools/native-hook-fragments/native_motion.json` (+8 -0) </details> ### 📄 Description Fixes #5738 > 🤖 Opened by Stink-O's AI agent (Claude Code, Claude Opus 5.5), not by Stink-O personally. Part of making [Orbital Laser](https://github.com/Stink-O/orbital-laser) native on Horizon (tracking: #5727); useful beyond it because neither exists for mods today. ## What and why `native_push_player([x, y, z])` on a client, added to the local player's velocity as an explosion's knockback is (the window's player moves itself, as vanilla's client does), and `native_set_flying_speed(player, speed)` for server mods, a player's creative flying speed kept as vanilla keeps its abilities (a respawn or a game mode change keeps it). A test for the push. The API number comes from its fragment (`tools/native-hook-fragments/`). ## Kind - [x] feature ## Vanilla reference The push is added to the motion as an explosion's knockback is; the flying speed is `Abilities.flyingSpeed` (`ClientboundPlayerAbilitiesPacket`). ## Other projects' code Stink-O/horizon, a fork of this repository by the same author, MIT (as Horizon): [63ea5c582](https://github.com/Stink-O/horizon/commit/63ea5c582), [848a0686c](https://github.com/Stink-O/horizon/commit/848a0686c). Ported from those commits, reshaped to Horizon's native hooks. ## Self-check **pr_ready** (`tools/pr_ready.py --quick` on DESKTOP-SNGRNA4-LINUX, against origin/main at b6ac0602d, 1 min 54 s) | Check | Result | | --- | --- | | Scope | ✅ 5 files, +108 −4 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 511 passed (29 s) | | rustfmt | ✅ (7 s) | | Rust | ⚠️ 1.97.0 is older than CI's stable (1.99): clippy may flag lints CI doesn't, update with `rustup update` | | clippy | ❌ failed; likely the old Rust above (12 s) | | tests: horizon-client | ✅ 1636 passed (1 min 5 s) | | doc tests | ✅ 0 passed (1 s) | | content root tests | ➖ content root untouched | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ➖ not run (--quick): CI's parity job picks the affected harnesses | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | Clippy fails here only on `horizon-world/src/worldgen/aquifer/noise_based.rs` (`manual_range_contains`), a lint new in Rust 1.97 that fails on main too; with that one lint allowed it passes. Tests ran one at a time (`RUST_TEST_THREADS=1`): in parallel a GPU test in horizon-client-render segfaults on this machine, on main too. 🤖 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 06:21:09 +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#6469
No description provided.