[PR #5406] [MERGED] Native mods: native_explode sets off an explosion from a server mod #6265

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/5406
Author: @Vaspyyy
Created: 10/31/2026
Status: ✅ Merged
Merged: 11/1/2026
Merged by: @ludovic111

Base: main ← Head: feat/native-explode


📝 Commits (4)

  • 9f2291c Native mods: native_explode sets off an explosion from a server mod
  • b7b36cc Merge remote-tracking branch 'upstream/main' into feat/native-explode
  • 436d039 native_explode: a nested blast starts sourceless and gives the outer blast its state back
  • 9c7dc13 Merge main into #5406

📊 Changes

4 files changed (+161 additions, -0 deletions)

View changed files

📝 crates/horizon-client/src/game.rs (+1 -0)
➕ crates/horizon-client/src/game/native_explosions.rs (+138 -0)
📝 docs/native-mods.md (+14 -0)
➕ tools/native-hook-fragments/native_explode.json (+8 -0)

📄 Description

Requested by Ransom · project thread

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

What and why

A server mod can now set off an explosion: native_explode(dimension, center, radius, fire, blast) runs Level.explode with no source entity through Horizon's own server_explode. Blocks break (native_explosion_detonate still sees them first), entities are hurt and pushed, fire lights the air above solid blocks, and players nearby hear and see it. NativeBlast::Keep, Block or Tnt picks what it does to blocks, with the matching drop decay rule.

It is refused, doing nothing, on a client's copy of the world, for another dimension, an unloaded chunk, or a radius outside 0 < radius <= 32 (vanilla's largest is 7; the cap keeps a mod from stalling the tick).

Until now a mod could only filter explosions (native_explosion_detonate), never start one. Mods that want a blast (artillery, mining charges, traps) need this. It is a helper only, requested through tools/native-hook-fragments/native_explode.json.

Kind

  • feature: something new for players (listed under New in the release notes)

Vanilla reference

Level.explode(Entity, double, double, double, float, boolean, Level.ExplosionInteraction) and ServerLevel.explode / ServerExplosion.explode, through the existing server_explode; ServerLevel.getDestroyType for the drop decay rules. No harness change: the blast itself is the one TNT uses.

Other projects' code

none

Self-check

Run from the fork against upstream/main (d30588e), Rust 1.97:

python3 tools/pr_ready.py --base upstream/main --quick
  Public tree: pass
  Python tests: fail   (test_perf_bench and test_triage_command fail the same way on main; unrelated)
  rustfmt: pass
  clippy: fail         (horizon-world/src/worldgen/aquifer/noise_based.rs:476 manual_range_contains, a lint new in 1.97, on main; untouched here)
  tests: horizon-client: pass
  doc tests: pass
cargo clippy -p horizon-client --bins --tests -- -D warnings -A clippy::manual_range_contains: pass

🤖 Generated with Claude Code

https://claude.ai/code/session_01XnU6QSxLfzUbudHhcvZtgy


🔄 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/5406 **Author:** [@Vaspyyy](https://github.com/Vaspyyy) **Created:** 10/31/2026 **Status:** ✅ Merged **Merged:** 11/1/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `feat/native-explode` --- ### 📝 Commits (4) - [`9f2291c`](https://github.com/horizon-rust/horizon/commit/9f2291cb870cd0e8f239c188b6a61fe3f2646162) Native mods: native_explode sets off an explosion from a server mod - [`b7b36cc`](https://github.com/horizon-rust/horizon/commit/b7b36ccbc72172f5c30c4800928612f2c78e106c) Merge remote-tracking branch 'upstream/main' into feat/native-explode - [`436d039`](https://github.com/horizon-rust/horizon/commit/436d03904748237450994ad514d42f51235bf38d) native_explode: a nested blast starts sourceless and gives the outer blast its state back - [`9c7dc13`](https://github.com/horizon-rust/horizon/commit/9c7dc13f6920364fb5aef65b8f2cb64ef18f8138) Merge main into #5406 ### 📊 Changes **4 files changed** (+161 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game.rs` (+1 -0) ➕ `crates/horizon-client/src/game/native_explosions.rs` (+138 -0) 📝 `docs/native-mods.md` (+14 -0) ➕ `tools/native-hook-fragments/native_explode.json` (+8 -0) </details> ### 📄 Description <!-- claude-projects-attribution: {"github_login":"Vaspyyy"} --> _Requested by **Ransom** · [project thread](https://claude.ai/code/project/chan_014LE6qsPXZ5YJ26HjaADSTZ?thread=cmsg_014LE6qsPXZ5YJ26HjaADSTZ1T4cmgL2QQ21WRYQVKMdRd)_ > 🤖 Opened by Vaspyyy's AI agent (Claude Code, Claude Opus 5.5), not by Vaspyyy personally. ## What and why A server mod can now set off an explosion: `native_explode(dimension, center, radius, fire, blast)` runs `Level.explode` with no source entity through Horizon's own `server_explode`. Blocks break (`native_explosion_detonate` still sees them first), entities are hurt and pushed, `fire` lights the air above solid blocks, and players nearby hear and see it. `NativeBlast::Keep`, `Block` or `Tnt` picks what it does to blocks, with the matching drop decay rule. It is refused, doing nothing, on a client's copy of the world, for another dimension, an unloaded chunk, or a radius outside `0 < radius <= 32` (vanilla's largest is 7; the cap keeps a mod from stalling the tick). Until now a mod could only filter explosions (`native_explosion_detonate`), never start one. Mods that want a blast (artillery, mining charges, traps) need this. It is a helper only, requested through `tools/native-hook-fragments/native_explode.json`. ## Kind - [x] feature: something new for players (listed under New in the release notes) ## Vanilla reference `Level.explode(Entity, double, double, double, float, boolean, Level.ExplosionInteraction)` and `ServerLevel.explode` / `ServerExplosion.explode`, through the existing `server_explode`; `ServerLevel.getDestroyType` for the drop decay rules. No harness change: the blast itself is the one TNT uses. ## Other projects' code none ## Self-check Run from the fork against `upstream/main` (d30588e), Rust 1.97: ``` python3 tools/pr_ready.py --base upstream/main --quick Public tree: pass Python tests: fail (test_perf_bench and test_triage_command fail the same way on main; unrelated) rustfmt: pass clippy: fail (horizon-world/src/worldgen/aquifer/noise_based.rs:476 manual_range_contains, a lint new in 1.97, on main; untouched here) tests: horizon-client: pass doc tests: pass cargo clippy -p horizon-client --bins --tests -- -D warnings -A clippy::manual_range_contains: pass ``` 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01XnU6QSxLfzUbudHhcvZtgy --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 06:16:44 +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#6265
No description provided.